* bug#57816: 28.2; Renaming a help buffer from help-mode-hook
@ 2022-09-15 4:43 Damien Cassou
2022-09-16 11:51 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Damien Cassou @ 2022-09-15 4:43 UTC (permalink / raw)
To: 57816
In GNU Emacs 28.2, I would like to automatically rename help buffers so
their name reflect their content. For example, I want *Help: car*
instead of just *Help* for the help buffer of `car'. Unfortunately,
adding #'rename-buffer to `help-mode-hook' doesn't work as this results
in 2 buffers instead of just one:
emacs --batch -Q \
--eval "(add-hook 'help-mode-hook (lambda () (rename-buffer \"*foo*\")))" \
--eval "(describe-function #'describe-function)" \
--eval "(prin1 (cons (get-buffer \"*Help*\") (get-buffer \"*foo*\")))"
prints
(#<buffer *Help*> . #<buffer *foo*>)
After the "rename", there is still a buffer with the old name. Is there
a more correct way to do this?
Best
--
Damien Cassou
"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#57816: 28.2; Renaming a help buffer from help-mode-hook
2022-09-15 4:43 bug#57816: 28.2; Renaming a help buffer from help-mode-hook Damien Cassou
@ 2022-09-16 11:51 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-16 11:51 UTC (permalink / raw)
To: Damien Cassou; +Cc: 57816
Damien Cassou <damien@cassou.me> writes:
> In GNU Emacs 28.2, I would like to automatically rename help buffers so
> their name reflect their content. For example, I want *Help: car*
> instead of just *Help* for the help buffer of `car'. Unfortunately,
> adding #'rename-buffer to `help-mode-hook' doesn't work as this results
> in 2 buffers instead of just one:
>
> emacs --batch -Q \
> --eval "(add-hook 'help-mode-hook (lambda () (rename-buffer \"*foo*\")))" \
> --eval "(describe-function #'describe-function)" \
> --eval "(prin1 (cons (get-buffer \"*Help*\") (get-buffer \"*foo*\")))"
>
> prints
>
> (#<buffer *Help*> . #<buffer *foo*>)
>
> After the "rename", there is still a buffer with the old name. Is there
> a more correct way to do this?
I can reproduce this in Emacs 28.2, but not in Emacs 29, so it looks
like this has been fixed already.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-16 11:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 4:43 bug#57816: 28.2; Renaming a help buffer from help-mode-hook Damien Cassou
2022-09-16 11:51 ` Lars Ingebrigtsen
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).