From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Tak Kunihiro <homeros.misasa@gmail.com>
Cc: 35487@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp,
Juri Linkov <juri@linkov.net>
Subject: bug#35487: Make visiting function from help-mode more customizable
Date: Thu, 16 May 2019 16:25:11 -0400 [thread overview]
Message-ID: <jwvy336duce.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86zhnmn5mc.fsf@misasa.okayama-u.ac.jp> (Tak Kunihiro's message of "Thu, 16 May 2019 17:52:27 +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.
BTW, this is a case where you could use the same approach as used in the
`other-frame-window` package but using a prefix command which says "use
the same window for the next command".
Stefan
next prev parent reply other threads:[~2019-05-16 20:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-29 12:30 bug#35487: Make visiting function from help-mode more customizable Tak Kunihiro
2019-04-29 19:54 ` Juri Linkov
2019-05-09 23:10 ` Tak Kunihiro
2019-05-10 8:00 ` martin rudalics
2019-05-11 20:42 ` Juri Linkov
2019-05-16 8:52 ` Tak Kunihiro
2019-05-16 20:25 ` Stefan Monnier [this message]
2019-05-17 10:03 ` Tak Kunihiro
2019-05-28 21:09 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvy336duce.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=35487@debbugs.gnu.org \
--cc=homeros.misasa@gmail.com \
--cc=juri@linkov.net \
--cc=tkk@misasa.okayama-u.ac.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).