Suppose I open one window with a Common Lisp file in it, and a second window with SLIME REPL in it (using M-x slime or whatever). Now, doing C-c C-d h
with point on a Common Lisp keyword brings up a window with the CLHS entry for that keyword (using w3m, and assuming everything has been configured correctly, but lets assume that is the case).
Now, I want the CLHS window to be set up, so that wherever I call C-c C-d h
, either in the Lisp file window, or in the SLIME REPL window, the CLHS page comes up in the same window. This currently does not happen. I am using some code which I found on the Emacs wiki, W3m: Browse url on other window, which helps but does not completely work. I think it works if only one window (besides the CLHS window) is open.
(setq browse-url-browser-function 'w3m-browse-url-other-window)
(defun w3m-browse-url-other-window (url &optional newwin)
(let ((w3m-pop-up-windows t))
(if (one-window-p) (split-window))
(other-window 1)
(w3m-browse-url url newwin)))
NOTE: This is probably a specific example of a more general question.