From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lawrence Mitchell Newsgroups: gmane.emacs.bugs Subject: bug#11686: 24.1.50; defun should return name Date: Fri, 22 Jun 2012 14:38:30 +0100 Message-ID: <87d34r4gbt.fsf@gmx.li> References: <87ipewb637.fsf@gnu.org> <87mx47h8wp.fsf@gmx.li> <874nqfl1r2.fsf@gmx.li> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1340372384 17006 80.91.229.3 (22 Jun 2012 13:39:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 22 Jun 2012 13:39:44 +0000 (UTC) To: 11686@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 22 15:39:43 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Si45J-0000s2-K1 for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Jun 2012 15:39:37 +0200 Original-Received: from localhost ([::1]:57644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si45J-000142-Kn for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Jun 2012 09:39:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si45B-00011N-Q5 for bug-gnu-emacs@gnu.org; Fri, 22 Jun 2012 09:39:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Si456-00045s-Td for bug-gnu-emacs@gnu.org; Fri, 22 Jun 2012 09:39:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si456-00045m-QG for bug-gnu-emacs@gnu.org; Fri, 22 Jun 2012 09:39:24 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Si48c-0007W4-KS for bug-gnu-emacs@gnu.org; Fri, 22 Jun 2012 09:43:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87ipewb637.fsf@gnu.org> Resent-From: Lawrence Mitchell Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Jun 2012 13:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11686 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134037257528877 (code B ref -1); Fri, 22 Jun 2012 13:43:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Jun 2012 13:42:55 +0000 Original-Received: from localhost ([127.0.0.1]:52731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Si48U-0007Vh-G6 for submit@debbugs.gnu.org; Fri, 22 Jun 2012 09:42:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37845) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Si48R-0007VZ-QS for submit@debbugs.gnu.org; Fri, 22 Jun 2012 09:42:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Si44l-00042f-KN for submit@debbugs.gnu.org; Fri, 22 Jun 2012 09:39:12 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:38884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si44l-00042Y-H5 for submit@debbugs.gnu.org; Fri, 22 Jun 2012 09:39:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si44f-0000zu-SP for bug-gnu-emacs@gnu.org; Fri, 22 Jun 2012 09:39:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Si44Z-000418-2Q for bug-gnu-emacs@gnu.org; Fri, 22 Jun 2012 09:38:57 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:34889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si44Y-00040g-RT for bug-gnu-emacs@gnu.org; Fri, 22 Jun 2012 09:38:50 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Si44S-00082R-QC for bug-gnu-emacs@gnu.org; Fri, 22 Jun 2012 15:38:44 +0200 Original-Received: from e4300lm.epcc.ed.ac.uk ([129.215.63.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Jun 2012 15:38:44 +0200 Original-Received: from wence by e4300lm.epcc.ed.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Jun 2012 15:38:44 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 44 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: e4300lm.epcc.ed.ac.uk User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) Cancel-Lock: sha1:a0dwKz425JnL2c0Evrb/Px3yrPI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61187 Archived-At: 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