emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Jumping to C source from *Help*


From: Juri Linkov
Subject: Re: Jumping to C source from *Help*
Date: Thu, 08 Apr 2004 09:12:14 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:
> Thanks.  I've installed my patch (with slight modifications)
> and it now deals with the above (though in elisp rather than in C).
>
> Please try it,

This is a very good thing!

But it reminded me that jumping from the *Help* buffer to the source
buffer still has one inconvenience: it selects the source buffer in a
different window.  It makes more sense to switch to the source buffer
in the same window, because the same text that is displayed in the
*Help* buffer, after switching will be visible in the docstring in the
source buffer.  So no information is duplicated on the screen.

For some time I used the following patch, and it's very convenient:

diff -u -r1.24 help-mode.el
--- emacs/lisp/help-mode.el     7 Apr 2004 19:35:05 -0000       1.24
+++ emacs/lisp/help-mode.el     8 Apr 2004 05:41:35 -0000
@@ -155,7 +155,8 @@
                           ((string-match "\\`src/\\(.*\\.c\\)" file)
                            (help-find-C-source fun (match-string 1 file) 'fun))
                           (t (find-function-search-for-symbol fun nil file)))))
-                    (pop-to-buffer (car location))
+                    (switch-to-buffer (car location))
                     (goto-char (cdr location))))
   'help-echo (purecopy "mouse-2, RET: find function's definition"))
 
@@ -167,7 +168,8 @@
                           ((string-match "\\`src/\\(.*\\.c\\)" file)
                            (help-find-C-source var (match-string 1 file) 'var))
                           (t (find-variable-noselect var file)))))
-                    (pop-to-buffer (car location))
+                    (switch-to-buffer (car location))
                     (goto-char (cdr location))))
   'help-echo (purecopy"mouse-2, RET: find variable's definition"))

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]