GNU bug report logs - #33150
27.0.50; defun, keyword option

Previous Next

Package: emacs;

Reported by: 濱田和明 <hmd24kaz <at> gmail.com>

Date: Thu, 25 Oct 2018 15:21:02 UTC

Severity: normal

Tags: notabug

Found in version 27.0.50

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 33150 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: 濱田和明 <hmd24kaz <at> gmail.com>
Cc: 33150 <at> debbugs.gnu.org
Subject: Re: bug#33150: 27.0.50; defun, keyword option
Date: Thu, 25 Oct 2018 18:14:20 -0400
tags 33150 notabug
close 33150
quit

濱田和明 <hmd24kaz <at> gmail.com> writes:

> (defun test-f (&key a b)
>   (or a b))
> -> test-f
> (test-f :a 1)
> There happen an error: (wrong-number-of-arguments (lambda (&key a b) (or
> a b)) 2)
> I am expecting the return value is 1.

You're looking for cl-defun, plain Emacs Lisp defun doesn't support &key
(so you defined a function of three args, where the first arg is called
"&key").




This bug report was last modified 6 years and 204 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.