* Re: commandp
[not found] <b4md4yfd1v5.fsf@jpl.org>
@ 2007-07-27 5:04 ` Richard Stallman
2007-07-27 6:37 ` commandp Stefan Monnier
0 siblings, 1 reply; 2+ messages in thread
From: Richard Stallman @ 2007-07-27 5:04 UTC (permalink / raw)
To: Katsumi Yamaoka; +Cc: emacs-devel
In the latest Emacs trunk the built-in function `commandp' returns
t or nil while it returned an interactive form or nil formerly.
Because of this, `defadvice' makes interactive Lisp functions non-
interactive.
I don't think that is entirely accurate. In Emacs 21.4. (commandp
'forward-char) and (commandp 'next-line) both return t, and they still
do.
I think, rather, that its return value may be t or the interactive
spec, in all Emacs versions. This is not a bug, since the documentation
says only that the value for a command is non-nil.
It seems a change occurred in its behavior recently, and this caused a
bug in advice. We need to fix this bug somehow. Making commandp
return the interactive spec for noncompiled functions written in Lisp
is one way.
But it might be cleaner to make advice.el call `interactive-form'
instead. Does that work?
Would someone please DTRT, then ack?
Date: Thu, 26 Jul 2007 17:07:41 +0900
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: emacs-pretest-bug@gnu.org
Organization: Emacsen advocacy group
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Subject: commandp
Hi,
In the latest Emacs trunk the built-in function `commandp' returns
t or nil while it returned an interactive form or nil formerly.
Because of this, `defadvice' makes interactive Lisp functions non-
interactive. See the `ad-interactive-form' function. Here is
an example of what it causes:
(defun foo ()
(interactive)
(message "Hello"))
=> foo
(commandp 'foo)
=> t
(let ((ad-default-compilation-action 'never))
(defadvice foo (around testing activate)
"testing"
(message "Good-bye")))
=> foo
(commandp 'foo)
=> nil
(pp (symbol-function 'foo))
=> (lambda nil
"$ad-doc: foo$"
t
(let (ad-return-value)
(message "Good-bye")
ad-return-value))
Regards,
_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
^ permalink raw reply [flat|nested] 2+ messages in thread