GNU bug report logs -
#35487
Make visiting function from help-mode more customizable
Previous Next
Full log
View this message in rfc822 format
>> (define-key help-mode-map (kbd "f") 'push-button-display-buffer)
>>
>> (defun push-button-display-buffer (&optional action)
>> (interactive)
>> (or action (setq action 'display-buffer-same-window))
>> (let ((display-buffer-alist
>> `((display-buffer-condition-from-help ,action))))
>> (push-button)))
>>
>> (defun display-buffer-condition-from-help (_buffer-name _action)
>> (with-current-buffer (window-buffer)
>> (eq major-mode 'help-mode)))
>
> I think the display-buffer-condition-from-help (which likely should
> have a final "-p" in its name) is only needed you you want to add it to
> the global value of display-buffer-alist.
>
> In the above code, since you're using a specific binding in
> help-mode-map, you presumably already know that (eq major-mode 'help-mode)
> so you can just rebind display-buffer-overriding-action.
Thank you Stefan for the help!
I think that following will open the code in the same window. I
wanted this for a long time...
#+begin_src emacs-lisp
(define-key help-mode-map (kbd "f") 'push-button-display-same-window)
(define-key help-mode-map (kbd "o") 'push-button)
(defun push-button-display-same-window ()
(interactive)
(let ((display-buffer-overriding-action '(display-buffer-same-window)))
(push-button)))
#+end_src
This bug report was last modified 5 years and 364 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.