Eli Zaretskii writes: >> From: Arthur Miller >> Cc: Juri Linkov , larsi@gnus.org, emacs-devel@gnu.org >> Date: Fri, 24 Sep 2021 21:57:13 +0200 >> >> > Please, no unnecessary generalizations of this kind. Or at least not >> > to cater to this particular request. I want a _help_ command, not >> > just a prefix that runs any command in the other window. because, for >> > starters, what if the *Help* buffer is not currently on display at >> > all? >> >> Here is one updated without the unnecessary let statement. > > Thanks, but I'd prefer a prefix command, so that you wouldn't need to > prompt for the key sequence, but expect the user to provide it > already. For example, "C-h M-h s" would show the definition of the > function or variable. I am sorry, but I don't really understand what you mean here. You would like to be able to type: C-u C-h M-h s, intead of C-h M-h s? Or you mean C-h M-h C-u s? C-h M-h is needed to switch control to the help buffer from the current buffer, then you are just typing commands as if the cursor was in the help buffer. I don't know, I don't really understand what you mean there, and I am not sure I would know how to implement that, so maybe someone else can help with that one? The obivous alternative I see is to globally define help-mode commands, as originally suggested and put them on global shortcuts or make help-mode-map globally accessible, but I think in practice remotely executing commands is better since the keyboard shortcuts involved are same but all interactive commands defined in help-mode become automatically avialable without any extra work. If prompt bothers you, we can pass empty string as prompt in cal to 'read-key-sequence'. I put a descriptive prompt just to make it more clear, but it is just cosmetics. Maybe there is other way; but I am not aware of it. > Also, the *Help* window should stay displayed, so any additional > buffers the command needs to pop (for example, to show the definition) > should not replace the *Help* buffer, it should pop in another window, > exactly like when I invoke the command from the *Help* buffer. Yes, I noticed myself. Since the current buffer is no longer help buffer, Emacs chooses a bit differently in which window to display source code/info buffer. Easy hack is to make help window dedicated to help buffer, as in the attched patch. I have put into the patch so it is done automatic; but maybe it is better to let users decide on that one by modifying buffer-display-alist?