* Command `vc-annotate' runs `help-mode-hook'?
@ 2020-10-13 1:10 Okam
2020-10-14 6:40 ` Michael Heerdegen
0 siblings, 1 reply; 4+ messages in thread
From: Okam @ 2020-10-13 1:10 UTC (permalink / raw)
To: help-gnu-emacs
Hello,
I was trying to add a function to `help-mode-hook' to automatically
rename the "*Help*" buffer. I found that the command that `vc-annotate'
was running this hook, and so breaking when the buffer was renamed
before the command completed.
Why does `vc-annotate' run `help-mode-hook', and is there a good way of
detecting this and similar cases?
Thank you,
Okam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Command `vc-annotate' runs `help-mode-hook'?
2020-10-13 1:10 Command `vc-annotate' runs `help-mode-hook'? Okam
@ 2020-10-14 6:40 ` Michael Heerdegen
2020-10-16 21:06 ` Okam
0 siblings, 1 reply; 4+ messages in thread
From: Michael Heerdegen @ 2020-10-14 6:40 UTC (permalink / raw)
To: Okam; +Cc: help-gnu-emacs
Okam <okamsn@protonmail.com> writes:
> Hello,
>
> I was trying to add a function to `help-mode-hook' to automatically
> rename the "*Help*" buffer.
May I ask why you want to rename it? I guess it could cause other
problems.
> Why does `vc-annotate' run `help-mode-hook'
That probably comes from `vc-annotate' calling
`with-output-to-temp-buffer'. I don't recall why it had been decided
that this macro performs help-mode setup, but it does.
> and is there a good way of detecting this and similar cases?
You could look at the buffer name? The answer depends on the set of
cases you want to handle.
Regards,
Michael.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Command `vc-annotate' runs `help-mode-hook'?
2020-10-14 6:40 ` Michael Heerdegen
@ 2020-10-16 21:06 ` Okam
2020-10-16 22:43 ` Stefan Monnier
0 siblings, 1 reply; 4+ messages in thread
From: Okam @ 2020-10-16 21:06 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: help-gnu-emacs
On 10/14/20 2:40 AM, Michael Heerdegen wrote:
>> I was trying to add a function to `help-mode-hook' to automatically
>> rename the "*Help*" buffer.
>
> May I ask why you want to rename it? I guess it could cause other
> problems.
I found a package that renamed Help buffers to include the name of the
variable/function being shown, but saw that this broke `vc-annotate'
This is helpful when I want to refer to multiple "*Help*" buffers.
>> Why does `vc-annotate' run `help-mode-hook'
>
> That probably comes from `vc-annotate' calling
> `with-output-to-temp-buffer'. I don't recall why it had been decided
> that this macro performs help-mode setup, but it does.
Thank you.
>> and is there a good way of detecting this and similar cases?
>
> You could look at the buffer name? The answer depends on the set of
> cases you want to handle.
This makes sense. I wasn't sure whether doing so would also have
unexpected behavior.
With thanks,
Okam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Command `vc-annotate' runs `help-mode-hook'?
2020-10-16 21:06 ` Okam
@ 2020-10-16 22:43 ` Stefan Monnier
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2020-10-16 22:43 UTC (permalink / raw)
To: help-gnu-emacs
> I found a package that renamed Help buffers to include the name of the
> variable/function being shown,
Then your hook function needs to check first whether the current buffer
shows the description of a function, of a variable, or of something else
(a face, ...).
> but saw that this broke `vc-annotate'
That's only if it doesn't notice that the buffer used by vc-annotate
doesn't show the description of a function or of a variable.
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-10-16 22:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-13 1:10 Command `vc-annotate' runs `help-mode-hook'? Okam
2020-10-14 6:40 ` Michael Heerdegen
2020-10-16 21:06 ` Okam
2020-10-16 22:43 ` Stefan Monnier
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).