GNU bug report logs - #35487
Make visiting function from help-mode more customizable

Previous Next

Package: emacs;

Reported by: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>

Date: Mon, 29 Apr 2019 12:31:02 UTC

Severity: wishlist

Tags: patch

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Tak Kunihiro <homeros.misasa <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 35487 <at> debbugs.gnu.org, martin rudalics <rudalics <at> gmx.at>, Tak Kunihiro <homeros.misasa <at> gmail.com>, tkk <at> misasa.okayama-u.ac.jp, Juri Linkov <juri <at> linkov.net>
Subject: bug#35487: Make visiting function from help-mode more customizable
Date: Fri, 17 May 2019 19:03:10 +0900
>> (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.