all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 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

* Re: commandp
  2007-07-27  5:04 ` commandp Richard Stallman
@ 2007-07-27  6:37   ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2007-07-27  6:37 UTC (permalink / raw)
  To: rms; +Cc: Katsumi Yamaoka, emacs-devel

> Would someone please DTRT, then ack?

Did it earlier today,


        Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-27  6:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <b4md4yfd1v5.fsf@jpl.org>
2007-07-27  5:04 ` commandp Richard Stallman
2007-07-27  6:37   ` commandp Stefan Monnier

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.