unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lawrence Mitchell <wence@gmx.li>
To: 11686@debbugs.gnu.org
Subject: bug#11686: 24.1.50; defun should return name
Date: Fri, 22 Jun 2012 14:38:30 +0100	[thread overview]
Message-ID: <87d34r4gbt.fsf@gmx.li> (raw)
In-Reply-To: <87ipewb637.fsf@gnu.org>

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.
 \f
 * 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@gmx.li>






  reply	other threads:[~2012-06-22 13:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12 20:58 bug#11686: 24.1.50; defun should return name Johan Bockgård
2012-06-13  9:13 ` Lawrence Mitchell
2012-06-13 12:27   ` Stefan Monnier
2012-06-13 14:34     ` Lawrence Mitchell
2012-06-18 15:58       ` Stefan Monnier
2012-06-22 13:38         ` Lawrence Mitchell [this message]
2012-06-24 17:08           ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87d34r4gbt.fsf@gmx.li \
    --to=wence@gmx.li \
    --cc=11686@debbugs.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).