From unknown Thu Aug 14 17:25:40 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#13305 <13305@debbugs.gnu.org> To: bug#13305 <13305@debbugs.gnu.org> Subject: Status: 24.2; describe-function gives incorrect function location information (for functions changed in a hook?) Reply-To: bug#13305 <13305@debbugs.gnu.org> Date: Fri, 15 Aug 2025 00:25:40 +0000 retitle 13305 24.2; describe-function gives incorrect function location inf= ormation (for functions changed in a hook?) reassign 13305 emacs submitter 13305 mdl@alum.mit.edu severity 13305 minor tag 13305 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 29 15:17:37 2012 Received: (at submit) by debbugs.gnu.org; 29 Dec 2012 20:17:38 +0000 Received: from localhost ([127.0.0.1]:36390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tp2qe-0000Hr-S7 for submit@debbugs.gnu.org; Sat, 29 Dec 2012 15:17:37 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47467) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tp2qY-0000Hd-9O for submit@debbugs.gnu.org; Sat, 29 Dec 2012 15:17:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tp2pV-0006KQ-JP for submit@debbugs.gnu.org; Sat, 29 Dec 2012 15:16:29 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:46607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tp2pV-0006KM-G2 for submit@debbugs.gnu.org; Sat, 29 Dec 2012 15:16:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tp2pR-0004hW-Fs for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 15:16:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tp2pM-0006J4-Tu for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 15:16:21 -0500 Received: from alum-mailsec-scanner-7.mit.edu ([18.7.68.19]:53265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tp2pM-0006Iw-NF for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 15:16:16 -0500 X-AuditID: 12074413-b7f786d0000008bb-34-50df4f8f4dfd Received: from outgoing-alum.mit.edu (OUTGOING-ALUM.MIT.EDU [18.7.68.33]) by alum-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 81.81.02235.F8F4FD05; Sat, 29 Dec 2012 15:16:15 -0500 (EST) Received: from foil.strangled.net (c-67-188-235-212.hsd1.ca.comcast.net [67.188.235.212]) (authenticated bits=0) (User authenticated as mdl@ALUM.MIT.EDU) by outgoing-alum.mit.edu (8.13.8/8.12.4) with ESMTP id qBTKGDIs028614 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 29 Dec 2012 15:16:14 -0500 From: Mark Lillibridge To: bug-gnu-emacs@gnu.org Subject: 24.2; describe-function gives incorrect function location information (for functions changed in a hook?) Date: Sat, 29 Dec 2012 12:16:09 -0800 Message-ID: <87ehi8ty0m.fsf@foil.strangled.net> MIME-Version: 1.0 Content-Type: text/plain X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKIsWRmVeSWpSXmKPExsUixO6iqNvvfz/AYMkxBYvvB6ospn48w+bA 5PH3/Qcmj7ZpZgFMUdw2SYklZcGZ6Xn6dgncGVd2PmYpWKJV8WxjD2MD40mFLkZODgkBE4k3 f/YyQdhiEhfurWfrYuTiEBK4zCgx9cFVFgjnKpPE3rX/GUGq2AQ0JaY/+84OYosISEp8vdPK 2sXIwSEsUCjx72otSFhIQEpi6aITYCUsAqoSWxpfsYOU8AroS3TNiwIJ8woISpyc+YQFxGYW kJA4+OIF8wRGnllIUrOQpBYwMq1ilEvMKc3VzU3MzClOTdYtTk7My0st0jXXy80s0UtNKd3E CAkW4R2Mu07KHWIU4GBU4uE9fftugBBrYllxZe4hRkkOJiVR3o8u9wOE+JLyUyozEosz4otK c1KLDzFKcDArifB+0AfK8aYkVlalFuXDpKQ5WJTEedWWqPsJCaQnlqRmp6YWpBbBZGU4OJQk eIP9gBoFi1LTUyvSMnNKENJMHJwgw7mkRIpT81JSixJLSzLiQfESXwyMGJAUD9BeS5B23uKC xFygKETrKUZdjl8rbz5lFGLJy89LlRLnTQEpEgApyijNg1sBSw2vGMWBPhbm9QKp4gGmFbhJ r4CWMAEtsea5A7KkJBEhJdXA6Lnx0zTn6y3a0Tk7Ij70RIgU18x7ukM7OI/t9079MCVnFbN0 D/MXVT0/38XO3WE2Q3ct94cJu+b+m+G7tX1/Q3m+T/PuF9MU5wfFBc6ofDzl87u3/VJ7l1+I XPZqu8rB8ryput31Man99Ua7WZdlMwhKrpCL4rm4S+in4XT953dnsXX6539lU2Ipzkg01GIu Kk4EALYUVdnoAgAA X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: mdl@alum.mit.edu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) While working on a patch, I ran into a really weird and misleading case where describe-function lied about where a function was located, making me think my redefinition of the function had been ignored. Here's a recipe to reproduce the problem: Start with emacs -q, do M-: (require 'rmailsum), then use C-h f on rmail-summary-output; you should (correctly) see: rmail-summary-output is an interactive compiled Lisp function in `rmailsum.el'. (rmail-summary-output &optional FILE-NAME N) Append this message to mail file FILE-NAME. This works with both mbox format and Babyl format files, outputting in the appropriate format for each. The default file name comes from `rmail-default-file', which is updated to the name you use in this command. A prefix argument N says to output that many consecutive messages from those in the summary, starting with the current one. Deleted messages are skipped and don't count. When called from Lisp code, N may be omitted and defaults to 1. This command always outputs the complete message header, even the header display is currently pruned. Note that the location of the function is correctly given as in rmailsum.el. Now start again with emacs -q then evaluate the following elisp code: ==================== cut here for elisp ==================== (add-hook 'rmail-mode-hook (function (lambda() (require 'rmailsum) (defun rmail-summary-output (&optional file-name n) "MODIFIED! Append this message to mail file FILE-NAME. This works with both mbox format and Babyl format files, outputting in the appropriate format for each. The default file name comes from `rmail-default-file', which is updated to the name you use in this command. A prefix argument N says to output that many consecutive messages from those in the summary, starting with the current one. Deleted messages are skipped and don't count. When called from Lisp code, N may be omitted and defaults to 1. This command always outputs the complete message header, even the header display is currently pruned. [mdl: patched for bug #12214]" (interactive (progn (require 'rmailout) (list (with-current-buffer rmail-buffer (rmail-output-read-file-name)) (prefix-numeric-value current-prefix-arg)))) (let ((i 0) prev-msg) (while (and (< i n) (progn (rmail-summary-goto-msg) (not (eq prev-msg (setq prev-msg (with-current-buffer rmail-buffer rmail-current-message)))))) (setq i (1+ i)) (with-current-buffer rmail-buffer (let ((rmail-delete-after-output nil)) (with-no-warnings (rmail-output file-name 1)))) (if rmail-delete-after-output (rmail-summary-delete-forward nil) (if (< i n) (rmail-summary-next-msg 1)))))) ))) ==================== cut here for elisp ==================== Basically, this replaces the built-in version of rmail-summary-output with a patched version; the patching is done only when Rmail started via the Rmail mode hook (I don't always use Rmail mode and don't want to unnecessarily load things to save on start up speed with slow connections). Now do M-x rmail then once again C-h f on rmail-summary-output; you should (incorrectly) see: rmail-summary-output is an interactive Lisp function in `rmailsum.el'. (rmail-summary-output &optional FILE-NAME N) MODIFIED! Append this message to mail file FILE-NAME. This works with both mbox format and Babyl format files, outputting in the appropriate format for each. The default file name comes from `rmail-default-file', which is updated to the name you use in this command. A prefix argument N says to output that many consecutive messages from those in the summary, starting with the current one. Deleted messages are skipped and don't count. When called from Lisp code, N may be omitted and defaults to 1. This command always outputs the complete message header, even the header display is currently pruned. [mdl: patched for bug #12214] Note that the modification has been made (see the MODIFIED! at the top) *BUT* help still thinks the function is located in rmailsum.el. By contrast, if I do the patching outside of the Rmail mode hook, (emacs -q, eval all but first 2 and last line, M-x rmail, then C-h f) I get: rmail-summary-output is an interactive Lisp function in `temporary'. (rmail-summary-output &optional FILE-NAME N) MODIFIED! Append this message to mail file FILE-NAME. This works with both mbox format and Babyl format files, outputting in the appropriate format for each. The default file name comes from `rmail-default-file', which is updated to the name you use in this command. A prefix argument N says to output that many consecutive messages from those in the summary, starting with the current one. Deleted messages are skipped and don't count. When called from Lisp code, N may be omitted and defaults to 1. This command always outputs the complete message header, even the header display is currently pruned. [mdl: patched for bug #12214] (temporary is the name of the file I evaluated the list from). - Mark From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 30 21:58:57 2012 Received: (at 13305) by debbugs.gnu.org; 31 Dec 2012 02:58:58 +0000 Received: from localhost ([127.0.0.1]:37468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TpVab-0006CR-8Y for submit@debbugs.gnu.org; Sun, 30 Dec 2012 21:58:57 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:45990) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TpVaX-0006CI-Pt for 13305@debbugs.gnu.org; Sun, 30 Dec 2012 21:58:54 -0500 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id qBV2vhwF028912; Sun, 30 Dec 2012 21:57:44 -0500 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id DC5E5AE3F6; Sun, 30 Dec 2012 21:57:42 -0500 (EST) From: Stefan Monnier To: mdl@alum.mit.edu Subject: Re: bug#13305: 24.2; describe-function gives incorrect function location information (for functions changed in a hook?) Message-ID: References: <87ehi8ty0m.fsf@foil.strangled.net> Date: Sun, 30 Dec 2012 21:57:42 -0500 In-Reply-To: <87ehi8ty0m.fsf@foil.strangled.net> (Mark Lillibridge's message of "Sat, 29 Dec 2012 12:16:09 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV4447=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4447> : streams <883798> : uri <1307490> X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: 13305 Cc: 13305@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) > Basically, this replaces the built-in version of > rmail-summary-output with a patched version; the patching is done only Don't do that. Use defadvice or advice-add instead. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 30 22:00:23 2012 Received: (at 13305) by debbugs.gnu.org; 31 Dec 2012 03:00:23 +0000 Received: from localhost ([127.0.0.1]:37472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TpVby-0006Fb-43 for submit@debbugs.gnu.org; Sun, 30 Dec 2012 22:00:23 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:38532) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TpVbw-0006FS-4E for 13305@debbugs.gnu.org; Sun, 30 Dec 2012 22:00:20 -0500 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id qBV2x5J6026517; Sun, 30 Dec 2012 21:59:07 -0500 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 6330DAE3F6; Sun, 30 Dec 2012 21:59:08 -0500 (EST) From: Stefan Monnier To: mdl@alum.mit.edu Subject: Re: bug#13305: 24.2; describe-function gives incorrect function location information (for functions changed in a hook?) Message-ID: References: <87ehi8ty0m.fsf@foil.strangled.net> Date: Sun, 30 Dec 2012 21:59:08 -0500 In-Reply-To: <87ehi8ty0m.fsf@foil.strangled.net> (Mark Lillibridge's message of "Sat, 29 Dec 2012 12:16:09 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV4447=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4447> : streams <883798> : uri <1307490> X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 13305 Cc: 13305@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) > (add-hook 'rmail-mode-hook > (function (lambda() > (require 'rmailsum) > (defun rmail-summary-output (&optional file-name n) I also *strongly* discourage the use of `defun' within another function. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 31 02:09:31 2012 Received: (at control) by debbugs.gnu.org; 31 Dec 2012 07:09:31 +0000 Received: from localhost ([127.0.0.1]:37569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TpZV3-0003tA-FG for submit@debbugs.gnu.org; Mon, 31 Dec 2012 02:09:30 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:52655) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TpZV1-0003t1-8C for control@debbugs.gnu.org; Mon, 31 Dec 2012 02:09:27 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1TpZTu-0002D5-OR for control@debbugs.gnu.org; Mon, 31 Dec 2012 02:08:18 -0500 Date: Mon, 31 Dec 2012 02:08:18 -0500 Message-Id: Subject: control message for bug 13305 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) tag 13305 wontfix From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 01 14:35:51 2013 Received: (at 13305) by debbugs.gnu.org; 1 Jan 2013 19:35:51 +0000 Received: from localhost ([127.0.0.1]:39302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tq7cs-0007RW-An for submit@debbugs.gnu.org; Tue, 01 Jan 2013 14:35:50 -0500 Received: from alum-mailsec-scanner-1.mit.edu ([18.7.68.12]:51435) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tq7cl-0007RJ-HC for 13305@debbugs.gnu.org; Tue, 01 Jan 2013 14:35:45 -0500 X-AuditID: 1207440c-b7f196d0000008bc-e8-50e33a4245c4 Received: from outgoing-alum.mit.edu (OUTGOING-ALUM.MIT.EDU [18.7.68.33]) by alum-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id F5.60.02236.24A33E05; Tue, 1 Jan 2013 14:34:26 -0500 (EST) Received: from foil.strangled.net (c-67-188-235-212.hsd1.ca.comcast.net [67.188.235.212]) (authenticated bits=0) (User authenticated as mdl@ALUM.MIT.EDU) by outgoing-alum.mit.edu (8.13.8/8.12.4) with ESMTP id r01JYNuE031817 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 1 Jan 2013 14:34:25 -0500 From: Mark Lillibridge To: Stefan Monnier Subject: Re: bug#13305: 24.2; describe-function gives incorrect function location information (for functions changed in a hook?) In-Reply-To: (message from Stefan Monnier on Sun, 30 Dec 2012 21:57:42 -0500) Date: Tue, 01 Jan 2013 11:34:22 -0800 Message-ID: <87d2xovgsh.fsf@foil.strangled.net> MIME-Version: 1.0 Content-Type: text/plain X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IRYndR1HWyehxgsOSLiMXOa1MYLaZ+PMNm 8e3XVmYHZo+/7z8weVyctI/ZY/2bvUwBzFHcNkmJJWXBmel5+nYJ3Bn7fv1hL+jjrLjzeQpb A+N89i5GTg4JAROJr+snsEHYYhIX7q0Hsrk4hAQuM0p83vSdBcK5wiTxuuczM0gVm4CmxPRn 38G6RQR0JU58O8sKYjMLSEq8fP+NCaRBWKCBUWLa0g4WkASnQKnE69bNYCuEBKQkli46AdbM IqAq8XXFIbAaXgF9iZOXVrFD2IISJ2c+YYEYKiFx8MUL5gmMfLOQpGYhSS1gZFrFKJeYU5qr m5uYmVOcmqxbnJyYl5dapGuol5tZopeaUrqJERJ6PDsYv62TOcQowMGoxMN7U/9xgBBrYllx Ze4hRkkOJiVR3m8WQCG+pPyUyozE4oz4otKc1OJDjBIczEoivMVfHgUI8aYkVlalFuXDpKQ5 WJTEeVWXqPsJCaQnlqRmp6YWpBbBZGU4OJQkeOssgYYKFqWmp1akZeaUIKSZODhBhnNJiRSn 5qWkFiWWlmTEg6IsvhgYZyApHqC98SDtvMUFiblAUYjWU4zGHD/+3HjKyPFr5c2njEIsefl5 qVLivGEgpQIgpRmleXCLYEnnFaM40N/CvC0gVTzAhAU37xXQKiagVVoMD0BWlSQipKQaGB3/ dL94ku2v4c3MeS45Pfn3jqPB7twyTEX6Mkb/rlucCVA18JjVyD/1lr7yPvEUX3bu3A+laydo m9ktq1zMmiYkk+b7guOdyWSuh3NurojZbu7T9YH1KtOT77xHJ5y+GtNRcXHxhwoDzr+1mQbF /co8DhamBrVabu3iaTufrpu8SWNDj3qJEktxRqKhFnNRcSIAvwJqORUDAAA= X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 13305 Cc: 13305@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: mdl@alum.mit.edu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Stefan Monnier writes: > > Basically, this replaces the built-in version of > > rmail-summary-output with a patched version; the patching is done only > > Don't do that. Use defadvice or advice-add instead. For some reason I was thinking that changes to interactive didn't work properly with advice. Just using defun can be more convenient than advice, however, when you are in a hurry for a temporary patch. It's too bad there isn't a macro for replace-defun that acts syntactically identical to defun except that it uses advice to patch lazily the built-in (e.g., part of Emacs distribution) function. This would be a lot easier for users to understand and use. For that matter, what would be really useful is a small (10-20 page?) guide to patching Emacs with this sort of useful information. Yes, I know there is a 800+ page elisp manual that contains a lot of this information somewhere (maybe?) But the reality is that the average person trying to patch Emacs doesn't have time to read the manual and limits themselves to Google searches. You don't discover advice that way. - Mark From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 01 14:36:55 2013 Received: (at 13305) by debbugs.gnu.org; 1 Jan 2013 19:36:55 +0000 Received: from localhost ([127.0.0.1]:39306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tq7du-0007TZ-7u for submit@debbugs.gnu.org; Tue, 01 Jan 2013 14:36:54 -0500 Received: from alum-mailsec-scanner-3.mit.edu ([18.7.68.14]:50275) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tq7dr-0007TR-G4 for 13305@debbugs.gnu.org; Tue, 01 Jan 2013 14:36:52 -0500 X-AuditID: 1207440e-b7f116d0000008ae-1d-50e33a86246e Received: from outgoing-alum.mit.edu (OUTGOING-ALUM.MIT.EDU [18.7.68.33]) by alum-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP id 67.0D.02222.68A33E05; Tue, 1 Jan 2013 14:35:34 -0500 (EST) Received: from foil.strangled.net (c-67-188-235-212.hsd1.ca.comcast.net [67.188.235.212]) (authenticated bits=0) (User authenticated as mdl@ALUM.MIT.EDU) by outgoing-alum.mit.edu (8.13.8/8.12.4) with ESMTP id r01JZWYm031863 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 1 Jan 2013 14:35:33 -0500 From: Mark Lillibridge To: Stefan Monnier Subject: Re: bug#13305: 24.2; describe-function gives incorrect function location information (for functions changed in a hook?) In-Reply-To: (message from Stefan Monnier on Sun, 30 Dec 2012 21:59:08 -0500) Date: Tue, 01 Jan 2013 11:35:30 -0800 Message-ID: <87a9ssvgql.fsf@foil.strangled.net> MIME-Version: 1.0 Content-Type: text/plain X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IRYndR1G2zehxgsPy9mMXOa1MYLaZ+PMNm 8e3XVmYHZo+/7z8weVyctI/ZY/2bvUwBzFHcNkmJJWXBmel5+nYJ3Bl7b/9hLVjAXPHy1DW2 BsZjTF2MnBwSAiYSS/8eh7LFJC7cW8/WxcjFISRwmVFix90PLBDOFSaJ7rU/WECq2AQ0JaY/ +84OYosI6Eqc+HaWFcRmFpCUePn+GxNIg7BAA6PEtKUdYA2cAqUSF5+/YQOxhQSkJJYuOgHW zCKgKtG5ZD9YDa+AvsSTU/fZIWxBiZMzn7BADJWQOPjiBfMERr5ZSFKzkKQWMDKtYpRLzCnN 1c1NzMwpTk3WLU5OzMtLLdI11svNLNFLTSndxAgJPb4djO3rZQ4xCnAwKvHwNuo+DhBiTSwr rsw9xCjJwaQkyvvNAijEl5SfUpmRWJwRX1Sak1p8iFGCg1lJhLf4y6MAId6UxMqq1KJ8mJQ0 B4uSOK/aEnU/IYH0xJLU7NTUgtQimKwMB4eSBO8XS6ChgkWp6akVaZk5JQhpJg5OkOFcUiLF qXkpqUWJpSUZ8aAoiy8GxhlIigdoLy8wwoV4iwsSc4GiEK2nGI05fvy58ZSR49fKm08ZhVjy 8vNSpcR5uUFKBUBKM0rz4BbBks4rRnGgv4V594LcwwNMWHDzXgGtYgJapcXwAGRVSSJCSqqB ccaEDw7/shw/r3byfH7d79GjjjmuuuXNGbp7kt0r75vbnW1vCciY1pE4SerI+V+va3hUGOT5 1m2LitxauNahTnxPlqdyU/jtf22FD6rXTw2UrX/QdHeyjMtDpwdqUSqVa4yPH13ktlKQW0+p 3FK5Ze6ZuAQm3aj1khEB3+Szbza7sR84N/+DEktxRqKhFnNRcSIA/rd5FBUDAAA= X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 13305 Cc: 13305@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: mdl@alum.mit.edu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Stefan Monnier writes: > > (add-hook 'rmail-mode-hook > > (function (lambda() > > (require 'rmailsum) > > (defun rmail-summary-output (&optional file-name n) > > I also *strongly* discourage the use of `defun' within another function. Is this in the elisp manual somewhere? It's exactly what one would do given experience with scheme or other lisps. - Mark From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 03 12:19:56 2013 Received: (at 13305) by debbugs.gnu.org; 3 Jan 2013 17:19:56 +0000 Received: from localhost ([127.0.0.1]:41825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqoSR-00081o-W4 for submit@debbugs.gnu.org; Thu, 03 Jan 2013 12:19:56 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:30465) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqoSQ-00081i-ON for 13305@debbugs.gnu.org; Thu, 03 Jan 2013 12:19:54 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtkGAG6Zu09FxK5W/2dsb2JhbABEDoFtshaBCIIWAQVWIxALDiYHCxQYDSSIIboJkEQDiEKacYFYgjBX X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="211283347" Received: from 69-196-174-86.dsl.teksavvy.com (HELO pastel.home) ([69.196.174.86]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 03 Jan 2013 12:19:52 -0500 Received: by pastel.home (Postfix, from userid 20848) id E10D658FAD; Thu, 3 Jan 2013 12:19:51 -0500 (EST) From: Stefan Monnier To: Mark Lillibridge Subject: Re: bug#13305: 24.2; describe-function gives incorrect function location information (for functions changed in a hook?) Message-ID: References: <87a9ssvgql.fsf@foil.strangled.net> Date: Thu, 03 Jan 2013 12:19:51 -0500 In-Reply-To: <87a9ssvgql.fsf@foil.strangled.net> (Mark Lillibridge's message of "Tue, 01 Jan 2013 11:35:30 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13305 Cc: 13305@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) >> > (add-hook 'rmail-mode-hook >> > (function (lambda() >> > (require 'rmailsum) >> > (defun rmail-summary-output (&optional file-name n) >> I also *strongly* discourage the use of `defun' within another function. > Is this in the elisp manual somewhere? It's exactly what one would > do given experience with scheme or other lisps. In Scheme, a local `define' does not affect the global definition. So it's a completely different operation (it's more like a `let'). Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 03 12:22:41 2013 Received: (at 13305) by debbugs.gnu.org; 3 Jan 2013 17:22:41 +0000 Received: from localhost ([127.0.0.1]:41830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqoV7-00086Q-Fh for submit@debbugs.gnu.org; Thu, 03 Jan 2013 12:22:41 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:7193) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqoV5-00086J-QI for 13305@debbugs.gnu.org; Thu, 03 Jan 2013 12:22:40 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtkGAG6Zu09FxK5W/2dsb2JhbABEDoFtshaBCIIVAQEEAVYjBQsLDiYHCxQYDSSIHAW6CZBEA4hCmnGBWIIwV4E4Gg X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="211283526" Received: from 69-196-174-86.dsl.teksavvy.com (HELO pastel.home) ([69.196.174.86]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 03 Jan 2013 12:22:36 -0500 Received: by pastel.home (Postfix, from userid 20848) id 3247158FAD; Thu, 3 Jan 2013 12:22:35 -0500 (EST) From: Stefan Monnier To: Mark Lillibridge Subject: Re: bug#13305: 24.2; describe-function gives incorrect function location information (for functions changed in a hook?) Message-ID: References: <87d2xovgsh.fsf@foil.strangled.net> Date: Thu, 03 Jan 2013 12:22:34 -0500 In-Reply-To: <87d2xovgsh.fsf@foil.strangled.net> (Mark Lillibridge's message of "Tue, 01 Jan 2013 11:34:22 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13305 Cc: 13305@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) > For some reason I was thinking that changes to interactive didn't > work properly with advice. Just using defun can be more convenient than > advice, however, when you are in a hurry for a temporary patch. Fine, but don't expect everything else to handle it just right. > It's too bad there isn't a macro for replace-defun that acts > syntactically identical to defun except that it uses advice to patch > lazily the built-in (e.g., part of Emacs distribution) function. Instead of (replace-defun foo (ARGS) BODY), you can write (advice-add foo :around (lambda (_ignore ARGS) BODY)) If needed we could add a :replace to advice-add, so it'd be (advice-add foo :replace (lambda (ARGS) BODY)), but I'm not convinced it's worth the trouble. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 22 21:18:19 2013 Received: (at 13305) by debbugs.gnu.org; 23 Jan 2013 02:18:19 +0000 Received: from localhost ([127.0.0.1]:45328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Txput-0004if-7M for submit@debbugs.gnu.org; Tue, 22 Jan 2013 21:18:19 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:56408) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Txpuq-0004iV-64 for 13305@debbugs.gnu.org; Tue, 22 Jan 2013 21:18:17 -0500 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r0N2GwTq031367; Tue, 22 Jan 2013 21:16:59 -0500 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id DDE14AE3F6; Tue, 22 Jan 2013 21:16:57 -0500 (EST) From: Stefan Monnier To: mdl@alum.mit.edu Subject: Re: bug#13305: 24.2; describe-function gives incorrect function location information (for functions changed in a hook?) Message-ID: References: <87d2xovgsh.fsf@foil.strangled.net> Date: Tue, 22 Jan 2013 21:16:57 -0500 In-Reply-To: <87d2xovgsh.fsf@foil.strangled.net> (Mark Lillibridge's message of "Tue, 01 Jan 2013 11:34:22 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV4469=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4469> : streams <893140> : uri <1325442> X-Spam-Score: -0.8 (/) X-Debbugs-Envelope-To: 13305 Cc: 13305@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) BTW, now that `defun' is macro-expanded when loading the file (thanks to eager macro-expansion), we could actually use it to record the file where this `defun' was found, even if that `defun' is (as in your case) only executed at some later time. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 01 03:03:21 2014 Received: (at control) by debbugs.gnu.org; 1 Feb 2014 08:03:21 +0000 Received: from localhost ([127.0.0.1]:43832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9VXs-0006lT-FA for submit@debbugs.gnu.org; Sat, 01 Feb 2014 03:03:20 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:34598) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9VXp-0006lJ-Bz for control@debbugs.gnu.org; Sat, 01 Feb 2014 03:03:17 -0500 Received: from [204.14.154.233] (helo=building.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1W9VXb-0002Vo-02 for control@debbugs.gnu.org; Sat, 01 Feb 2014 09:03:03 +0100 Date: Sat, 01 Feb 2014 00:02:11 -0800 Message-Id: <87a9ebntvg.fsf@building.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #13305 X-MailScanner-ID: 1W9VXb-0002Vo-02 X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1391846584.25647@L/mUWa/4pLPeSHFIfZ34hA X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) close 13305 From unknown Thu Aug 14 17:25:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 01 Mar 2014 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator