emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: commandp


From: Richard Stallman
Subject: Re: commandp
Date: Fri, 27 Jul 2007 01:04:59 -0400

    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 <address@hidden>
To: address@hidden
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
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug





reply via email to

[Prev in Thread] Current Thread [Next in Thread]