all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Following links from help buffers - how to modify?
@ 2005-06-02 12:00 David Reitter
  2005-06-02 18:08 ` Kevin Rodgers
  0 siblings, 1 reply; 3+ messages in thread
From: David Reitter @ 2005-06-02 12:00 UTC (permalink / raw)


Hi,

I've advised my switch-to-buffer to open buffers in new frames in  
order to take advantage of my native window manager.

Turns out that this doesn't work at all for links to source code in  
help mode. When a link to a source definition is clicked in a help  
buffer (suppose you have done C-h f <function>), the source file  
opens in SOME other window - probably the one that the help buffer  
was called from.

Now I don't like that at all, and I've gone through the sources to  
find out how a link is followed, but I'm still clueless.

Why doesn't link-following go through  switch-to-buffer-other-window?

Thanks for your advice on what to advise here :)

-- D

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

* Re: Following links from help buffers - how to modify?
  2005-06-02 12:00 Following links from help buffers - how to modify? David Reitter
@ 2005-06-02 18:08 ` Kevin Rodgers
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2005-06-02 18:08 UTC (permalink / raw)


David Reitter wrote:
 > I've advised my switch-to-buffer to open buffers in new frames in  order
 > to take advantage of my native window manager.
 >
 > Turns out that this doesn't work at all for links to source code in
 > help mode. When a link to a source definition is clicked in a help
 > buffer (suppose you have done C-h f <function>), the source file  opens
 > in SOME other window - probably the one that the help buffer  was called
 > from.
 >
 > Now I don't like that at all, and I've gone through the sources to  find
 > out how a link is followed, but I'm still clueless.
 >
 > Why doesn't link-following go through  switch-to-buffer-other-window?

Because it goes through pop-to-buffer (see describe-function-1 in
help.el):

     (if file-name
	(progn
	  (princ " in `")
	  ;; We used to add .el to the file name,
	  ;; but that's completely wrong when the user used load-file.
	  (princ file-name)
	  (princ "'")
	  ;; Make a hyperlink to the library.
	  (with-current-buffer "*Help*"
	    (save-excursion
	      (re-search-backward "`\\([^`']+\\)'" nil t)
	      (help-xref-button
	       1
	       #'(lambda (fun file)
		   (require 'find-func)
		   ;; Don't use find-function-noselect because it follows
		   ;; aliases (which fails for built-in functions).
		   (let* ((location (find-function-search-for-symbol
				     fun nil file)))
		     (pop-to-buffer (car location))
		     (goto-char (cdr location))))
	       (list function file-name)
	       "mouse-2, RET: find function's definition")))))

-- 
Kevin Rodgers

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

* Re: Following links from help buffers - how to modify?
       [not found] <mailman.2911.1117714454.25862.help-gnu-emacs@gnu.org>
@ 2005-06-05 23:10 ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2005-06-05 23:10 UTC (permalink / raw)


> I've advised my switch-to-buffer to open buffers in new frames in  order to
> take advantage of my native window manager.

You don't need to do that (except for some rare cases which you should
instead report as bugs).  Instead, just set pop-up-frames to t and maybe
also set special-display-regexp to something useful.


        Stefan

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

end of thread, other threads:[~2005-06-05 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-02 12:00 Following links from help buffers - how to modify? David Reitter
2005-06-02 18:08 ` Kevin Rodgers
     [not found] <mailman.2911.1117714454.25862.help-gnu-emacs@gnu.org>
2005-06-05 23:10 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.