unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#2438: Unable to find location of adviced function
@ 2009-02-22 21:52 ` Juri Linkov
  2009-06-28  5:15   ` bug#2438: marked as done (Unable to find location of adviced function) Emacs bug Tracking System
  0 siblings, 1 reply; 2+ messages in thread
From: Juri Linkov @ 2009-02-22 21:52 UTC (permalink / raw)
  To: emacs-pretest-bug

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/






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#2438: marked as done (Unable to find location of adviced function)
  2009-02-22 21:52 ` bug#2438: Unable to find location of adviced function Juri Linkov
@ 2009-06-28  5:15   ` Emacs bug Tracking System
  0 siblings, 0 replies; 2+ messages in thread
From: Emacs bug Tracking System @ 2009-06-28  5:15 UTC (permalink / raw)
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]


Your message dated Sun, 28 Jun 2009 01:08:20 -0400
with message-id <87y6rdoshn.fsf@stupidchicken.com>
and subject line Re: Unable to find location of adviced function
has caused the Emacs bug report #2438,
regarding Unable to find location of adviced function
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
2438: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=2438
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3449 bytes --]

From: Juri Linkov <juri@jurta.org>
To: emacs-pretest-bug@gnu.org
Subject: Unable to find location of adviced function
Date: Sun, 22 Feb 2009 23:52:41 +0200
Message-ID: <874oymjjpy.fsf@jurta.org>

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/



[-- Attachment #3: Type: message/rfc822, Size: 1797 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: Juri Linkov <juri@jurta.org>
Cc: 2438-done@emacsbugs.donarmstrong.com
Subject: Re: Unable to find location of adviced function
Date: Sun, 28 Jun 2009 01:08:20 -0400
Message-ID: <87y6rdoshn.fsf@stupidchicken.com>

> "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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-28  5:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87y6rdoshn.fsf@stupidchicken.com>
2009-02-22 21:52 ` bug#2438: Unable to find location of adviced function Juri Linkov
2009-06-28  5:15   ` bug#2438: marked as done (Unable to find location of adviced function) Emacs bug Tracking System

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).