all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David PONCE <david.ponce@wanadoo.fr>
Cc: emacs-pretest-bug <emacs-pretest-bug@gnu.org>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: &optional arguments in defuns stopped working
Date: Mon, 29 Mar 2004 10:44:48 +0200 (CEST)	[thread overview]
Message-ID: <10737199.1080549888704.JavaMail.www@wwinf0301> (raw)

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  <monnier@iro.umontreal.ca>

	* 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));

             reply	other threads:[~2004-03-29  8:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-29  8:44 David PONCE [this message]
2004-03-29 12:49 ` &optional arguments in defuns stopped working Kim F. Storm
2004-03-29 14:01 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10737199.1080549888704.JavaMail.www@wwinf0301 \
    --to=david.ponce@wanadoo.fr \
    --cc=emacs-devel@gnu.org \
    --cc=emacs-pretest-bug@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.