Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

17
  • Wow, thank you for an excellent answer. I had progressed to save/restore the window config, and had created a my-help-quit function, while trying to rebind the help-map key inside of with-help-window. But it wasn't working. I now see you bind the key inside the Help buffer (not the Help window like I was doing) after the buffer is set up. I guess my binding was clobbered by the buffer setup. A lesson learned. Everything is working now. Many thanks. Commented Jun 18, 2016 at 23:14
  • There are two (2) opportunities to act directly upon the *Help* buffer before it finishes -- the temp-buffer-window-setup-hook which runs help-mode-setup and then anything else already/previously assigned to the hook; and, then the temp-buffer-window-show-hook which runs help-mode-finish and anything already/previously assigned to the hook. help-mode-setup should remain first in time, but you could add something behind it by binding either one of those aforementioned hooks with custom stuff. In that scenario, you would not need with-current-buffer. Commented Jun 18, 2016 at 23:49
  • Agreed. I looked at both help-mode-setup and help-mode-finish, but they both ran before the buffer was displayed. The key problem was to redirect the "q" keybinding, and you showed me how to do that in the buffer (not the window, which I was trying to do). PS. I tried to write a solution as (defmacro with-full-frame-help-window, but the macro still requires a separate function to handle the "q" and window restoration action. I will post my completed functions below. Commented Jun 18, 2016 at 23:58
  • I updated the answer with a second example that uses a self-contained macro that does everything that the first example does. Commented Jun 19, 2016 at 0:58
  • 1
    This also works for me, to replace the hardcoded "Help" buffer reference to the current buffer, because the restoration lambda is a buffer-local function. ... (kill-buffer (current-buffer)))))). The macro took a buffer-name as argument, and killed "Help", so there could be a problem if the caller used a buffer whose name was different. I modified my macro to remove the buffer-name parameter, and generated/killed the same buffer inside the defmacro. Commented Jun 19, 2016 at 3:56