[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: &optional arguments in defuns stopped working
From: |
David PONCE |
Subject: |
Re: &optional arguments in defuns stopped working |
Date: |
Mon, 29 Mar 2004 10:44:48 +0200 (CEST) |
Hi,
> I use the latest cvs emacs. When I define a function like this:
>
> (defun test-o (&optional arg)
> (interactive "P")
> (message "arg: %S" arg))
>
>
> M-x test-o yields:
> Debugger entered--Lisp error: (void-function &optional)
> (&optional arg)
> * call-interactively(test-o)
> execute-extended-command(nil)
> call-interactively(execute-extended-command)
>
> There seems to be something wrong with the lisp parser...
It seems that the problem is due to this change made into callint.c:
2004-03-28 Stefan Monnier <address@hidden>
* eval.c (Fcommandp): Simplify.
* data.c (Finteractive_form): Rename from Fsubr_interactive_form.
Extend to handle all kinds of functions.
* lisp.h (Finteractive_form): Declare.
* callint.c (Fcall_interactively): Use it.
It looks that the lisp object 'form' is not initialized in callint.c.
After I applied the following small patch the problem disappeared.
Sincerely,
David
Index: src/callint.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/callint.c,v
retrieving revision 1.129
diff -c -r1.129 callint.c
*** src/callint.c 29 Mar 2004 00:49:00 -0000 1.129
--- src/callint.c 29 Mar 2004 08:37:16 -0000
***************
*** 351,357 ****
{
Lisp_Object form;
GCPRO2 (function, prefix_arg);
! Finteractive_form (function);
UNGCPRO;
if (CONSP (form))
specs = filter_specs = Fcar (XCDR (form));
--- 351,357 ----
{
Lisp_Object form;
GCPRO2 (function, prefix_arg);
! form = Finteractive_form (function);
UNGCPRO;
if (CONSP (form))
specs = filter_specs = Fcar (XCDR (form));