1

Hitting RET with point on a package name in the *Packages* buffer opens a help buffer, named "Help", describing the package. RET here invokes package-menu-describe-package which in turn calls describe-package which uses with-help-buffer to create this window. How can I customize the name of this buffer?

1

No, describe-package uses with-help-window (function/macro with-help-buffer does not exist).

And describe-package explicitly intends to show buffer *Help* in the help window, not another buffer. It purposely wants to replaces any current contents of buffer *Help*.

You should not try to make it use another buffer. If you really want to do that, then define your own command (e.g., based on the code of describe-package), and use that instead. You can, for example, remap the keys that are bound to describe-package to your command.

Alternatively, if all you want to do is change the name of the help buffer after it is created and shown, then just do that. Use command (function) rename-buffer - interactively or in Lisp code.

I bind rename-buffer to C-M-S-f1, and I use it quite often - in particular, to keep a *Help* buffer so that some help command does not overwrite its contents.

  • +1. I have display-buffer-alist customized to open all *Help* buffers in a particular frame and switch focus to it. However, I don't want to do this for a *Help* buffer spawned by describe-package. Changing the name would have been easy to handle with display-buffer-alist. I guess I should look at defadviceing describe-package? – Pradhan Feb 11 '15 at 1:08
  • 1
    Why not just remap its keys to your own (similar) command? If you need to use something more than remapping (e.g., because of a particular keymap), consider substitute-key-definition. – Drew Feb 11 '15 at 2:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.