Subject: bug#35487: Make visiting function from help-mode more customizable

From: Tak Kunihiro <[email-masked]>
Date: Thu, 16 May 2019 17:52:27 +0900

I configured `f' in help-mode in following way based on comments
and now it works good.

Thank you Juri and Martin for the responses!

#+begin_src emacs-lisp
(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)))
#+end_src