GNU bug report logs - #2438
Unable to find location of adviced function

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Sun, 22 Feb 2009 22:05:07 UTC

Severity: normal

Tags: patch

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 2438 in the body.
You can then email your comments to 2438 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2438; Package emacs. (Sun, 22 Feb 2009 22:05:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 22 Feb 2009 22:05:07 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: emacs-pretest-bug <at> gnu.org
Subject: Unable to find location of adviced function
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/




Tags added: patch Request was from Juanma Barranquero <lekktu <at> gmail.com> to control <at> emacsbugs.donarmstrong.com. (Mon, 23 Feb 2009 11:30:03 GMT) Full text and rfc822 format available.

Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. (Sun, 28 Jun 2009 05:15:05 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> jurta.org>:
bug acknowledged by developer. (Sun, 28 Jun 2009 05:15:05 GMT) Full text and rfc822 format available.

Message #12 received at 2438-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 2438-done <at> debbugs.gnu.org
Subject: Re: Unable to find location of adviced function
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.



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Sun, 26 Jul 2009 14:24:19 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 25 days ago.

Previous Next


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