Subject: bug#2438 closed by Chong Yidong <[email-masked]> (Re: Unable to find location of adviced function)

From: [email-masked] (Emacs bug Tracking System)
Date: Sun, 28 Jun 2009 05:15:05 +0000

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#2438: Unable to find location of adviced function

It has been closed by Chong Yidong <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Chong Yidong <[email-masked]> by
replying to this email.

-- 
2438: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2438
Emacs Bug Tracking System
Contact [email-masked] with problems

Subject: Re: Unable to find location of adviced function
From: Chong Yidong <[email-masked]>
To: Juri Linkov <[email-masked]>
Cc: [email-masked]
Date: Sun, 28 Jun 2009 01:08:20 -0400

> "Unable to find location in file"
>
> That's because `describe-function-1' uses the variable `real-function'
> that holds the value "ad-Orig-test1" instead of the variable `function'
> with the correct value "test1" referring to the original definition.
>
> This can be fixed with the following patch:

I've checked your patch into CVS trunk.  Thanks.

Subject: Unable to find location of adviced function
From: Juri Linkov <[email-masked]>
To: [email-masked]
Date: Sun, 22 Feb 2009 23:52:41 +0200

Test case:

1. Create a file test.el with:

(defun test1 ()
  (interactive)
  (message "Test1"))

(defadvice test1 (around my-test1 act)
  (message "Test1 pre")
  ad-do-it
  (message "Test1 post"))

2. Load it.

3. Type `C-h f test1 RET'.

4. Follow the link `test.el' to the source code.

It fails with the error message:

"Unable to find location in file"

That's because `describe-function-1' uses the variable `real-function'
that holds the value "ad-Orig-test1" instead of the variable `function'
with the correct value "test1" referring to the original definition.

This can be fixed with the following patch:

Index: lisp/help-fns.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/help-fns.el,v
retrieving revision 1.131
diff -u -r1.131 help-fns.el
--- lisp/help-fns.el	5 Jan 2009 03:19:15 -0000	1.131
+++ lisp/help-fns.el	22 Feb 2009 21:51:25 -0000
@@ -406,7 +406,7 @@
 	(with-current-buffer standard-output
 	  (save-excursion
 	    (re-search-backward "`\\([^`']+\\)'" nil t)
-	    (help-xref-button 1 'help-function-def real-function file-name))))
+	    (help-xref-button 1 'help-function-def function file-name))))
       (princ ".")
       (with-current-buffer (help-buffer)
 	(fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point))

-- 
Juri Linkov
http://www.jurta.org/emacs/