GNU bug report logs - #11686
24.1.50; defun should return name

Previous Next

Package: emacs;

Reported by: Johan Bockgård <bojohan <at> gnu.org>

Date: Tue, 12 Jun 2012 21:02:02 UTC

Severity: normal

Found in version 24.1.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lawrence Mitchell <wence <at> gmx.li>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#11686: 24.1.50; defun should return name
Date: Fri, 22 Jun 2012 14:38:30 +0100
Stefan Monnier wrote:
>>> Maybe a simpler way is to change defalias to return the name rather than
>>> the value.
>> But defalias says:
>> | (defalias SYMBOL DEFINITION &optional DOCSTRING)
>> | Set SYMBOL's function definition to DEFINITION, and return DEFINITION.
>> So you'll probably then get a bug report about that instead.

> We'll see, I just installed a patch that does that.

I think the following (NEWS) patch should be applied on top.
This is an incompatible change to defalias.  So it should go in
the appropriate part of NEWS.  Additionally, we should mention
defmacro and defun.

diff --git a/etc/NEWS b/etc/NEWS
index 3cd4d21..65f4269 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -418,6 +418,12 @@ Only variables defined using `defcustom' are considered user options.
 The function `user-variable-p' is now an obsolete alias for
 `custom-variable-p'.
 
++++
+** The return values of `defalias', `defun' and `defmacro' have changed,
+and are now undefined.  For backwards compatibility, defun and
+defmacro currently return the name of the newly defined function/macro
+but this should not be relied upon.
+
 ** `face-spec-set' no longer sets frame-specific attributes when the
 third argument is a frame (that usage was obsolete since Emacs 22.2).
 
@@ -434,8 +440,6 @@ still be supported for Emacs 24.x.
 
 * Lisp changes in Emacs 24.2
 
-** The return value of `defalias' has changed and is now undefined.
-
 ** `defun' also accepts a (declare DECLS) form, like `defmacro'.
 The interpretation of the DECLS is determined by `defun-declarations-alist'.
 

-- 
Lawrence Mitchell <wence <at> gmx.li>





This bug report was last modified 13 years and 30 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.