* Customize how xrefs are followed in help-mode?
@ 2019-05-16 19:18 Eric Abrahamsen
2019-05-16 19:22 ` Noam Postavsky
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2019-05-16 19:18 UTC (permalink / raw)
To: emacs-devel
It's always bothered me that following a function/variable definition
button from a *Help* buffer goes to the file in a separate window -- I
almost always want to re-use the *Help* window.
Essentially, help-mode.el:209 hard-codes the use of `pop-to-buffer', I'd
like to be able to use `pop-to-buffer-same-window'.
From a user's standpoint, I guess what I'd prefer is to be able to give
a prefix arg to RET when following the button, but I don't see any way
of passing that arg down, plus there's no good equivalent for the mouse
click.
Would people consider a customization option to control this?
Eric
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Customize how xrefs are followed in help-mode?
2019-05-16 19:18 Customize how xrefs are followed in help-mode? Eric Abrahamsen
@ 2019-05-16 19:22 ` Noam Postavsky
2019-05-16 19:30 ` Eric Abrahamsen
2019-05-17 12:55 ` Stefan Monnier
2019-05-19 19:50 ` Juri Linkov
2 siblings, 1 reply; 8+ messages in thread
From: Noam Postavsky @ 2019-05-16 19:22 UTC (permalink / raw)
To: Eric Abrahamsen; +Cc: Emacs developers
On Thu, 16 May 2019 at 15:19, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>
> It's always bothered me that following a function/variable definition
> button from a *Help* buffer goes to the file in a separate window -- I
> almost always want to re-use the *Help* window.
>
> Essentially, help-mode.el:209 hard-codes the use of `pop-to-buffer', I'd
> like to be able to use `pop-to-buffer-same-window'.
>
> From a user's standpoint, I guess what I'd prefer is to be able to give
> a prefix arg to RET when following the button, but I don't see any way
> of passing that arg down, plus there's no good equivalent for the mouse
> click.
>
> Would people consider a customization option to control this?
I think this the same as Bug#35487, where there are some suggestions
to use display-buffer-alist to control this.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Customize how xrefs are followed in help-mode?
2019-05-16 19:22 ` Noam Postavsky
@ 2019-05-16 19:30 ` Eric Abrahamsen
2019-05-16 20:14 ` Noam Postavsky
0 siblings, 1 reply; 8+ messages in thread
From: Eric Abrahamsen @ 2019-05-16 19:30 UTC (permalink / raw)
To: emacs-devel
Noam Postavsky <npostavs@gmail.com> writes:
> On Thu, 16 May 2019 at 15:19, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>>
>> It's always bothered me that following a function/variable definition
>> button from a *Help* buffer goes to the file in a separate window -- I
>> almost always want to re-use the *Help* window.
>>
>> Essentially, help-mode.el:209 hard-codes the use of `pop-to-buffer', I'd
>> like to be able to use `pop-to-buffer-same-window'.
>>
>> From a user's standpoint, I guess what I'd prefer is to be able to give
>> a prefix arg to RET when following the button, but I don't see any way
>> of passing that arg down, plus there's no good equivalent for the mouse
>> click.
>>
>> Would people consider a customization option to control this?
>
> I think this the same as Bug#35487, where there are some suggestions
> to use display-buffer-alist to control this.
Oh weird, Tak Kunihiro posted his final solution (which I'm stealing)
just a few hours ago, dunno how I missed that.
Thanks!
Eric
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Customize how xrefs are followed in help-mode?
2019-05-16 19:18 Customize how xrefs are followed in help-mode? Eric Abrahamsen
2019-05-16 19:22 ` Noam Postavsky
@ 2019-05-17 12:55 ` Stefan Monnier
2019-05-17 16:16 ` Eric Abrahamsen
2019-05-19 19:50 ` Juri Linkov
2 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2019-05-17 12:55 UTC (permalink / raw)
To: emacs-devel
> It's always bothered me that following a function/variable definition
> button from a *Help* buffer goes to the file in a separate window -- I
> almost always want to re-use the *Help* window.
While it doesn't offer such a thing yet, it should be easy to extend
`other-frame-window` to also offer a `ofw-same-window` prefix command,
to solve this dilemma once and for all.
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Customize how xrefs are followed in help-mode?
2019-05-17 12:55 ` Stefan Monnier
@ 2019-05-17 16:16 ` Eric Abrahamsen
0 siblings, 0 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2019-05-17 16:16 UTC (permalink / raw)
To: emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> It's always bothered me that following a function/variable definition
>> button from a *Help* buffer goes to the file in a separate window -- I
>> almost always want to re-use the *Help* window.
>
> While it doesn't offer such a thing yet, it should be easy to extend
> `other-frame-window` to also offer a `ofw-same-window` prefix command,
> to solve this dilemma once and for all.
The last solution on #35487 is pretty concise, though...
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Customize how xrefs are followed in help-mode?
2019-05-16 19:18 Customize how xrefs are followed in help-mode? Eric Abrahamsen
2019-05-16 19:22 ` Noam Postavsky
2019-05-17 12:55 ` Stefan Monnier
@ 2019-05-19 19:50 ` Juri Linkov
2019-05-21 0:31 ` Eric Abrahamsen
2 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2019-05-19 19:50 UTC (permalink / raw)
To: Eric Abrahamsen; +Cc: emacs-devel
> From a user's standpoint, I guess what I'd prefer is to be able to give
> a prefix arg to RET when following the button, but I don't see any way
> of passing that arg down, plus there's no good equivalent for the mouse
> click.
To depend on a prefix arg is a good idea.
(defun display-buffer-from-help-p (_buffer-name _action)
(when current-prefix-arg
(with-current-buffer (window-buffer)
(eq major-mode 'help-mode))))
(setq display-buffer-alist '((display-buffer-from-help-p
display-buffer-same-window)))
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Customize how xrefs are followed in help-mode?
2019-05-19 19:50 ` Juri Linkov
@ 2019-05-21 0:31 ` Eric Abrahamsen
0 siblings, 0 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2019-05-21 0:31 UTC (permalink / raw)
To: Juri Linkov; +Cc: emacs-devel
On 05/19/19 22:50 PM, Juri Linkov wrote:
>> From a user's standpoint, I guess what I'd prefer is to be able to give
>> a prefix arg to RET when following the button, but I don't see any way
>> of passing that arg down, plus there's no good equivalent for the mouse
>> click.
>
> To depend on a prefix arg is a good idea.
>
> (defun display-buffer-from-help-p (_buffer-name _action)
> (when current-prefix-arg
> (with-current-buffer (window-buffer)
> (eq major-mode 'help-mode))))
>
> (setq display-buffer-alist '((display-buffer-from-help-p
> display-buffer-same-window)))
That's a nice solution, too, thanks!
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-05-21 0:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-16 19:18 Customize how xrefs are followed in help-mode? Eric Abrahamsen
2019-05-16 19:22 ` Noam Postavsky
2019-05-16 19:30 ` Eric Abrahamsen
2019-05-16 20:14 ` Noam Postavsky
2019-05-17 12:55 ` Stefan Monnier
2019-05-17 16:16 ` Eric Abrahamsen
2019-05-19 19:50 ` Juri Linkov
2019-05-21 0:31 ` Eric Abrahamsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.