emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Control help- and Info-mode buffers from other buffers


From: Juri Linkov
Subject: Re: Control help- and Info-mode buffers from other buffers
Date: Fri, 02 Jun 2023 19:13:30 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

> I hope I am not misunderstood here. I certainly don't dislike what Juri does; 
> on
> contrary. I made that Reddit thread because I very much was looking for
> something similar, and I am using pre/post hack myself. However I see some
> fundamental issue in how Emacs works, which I am not sure can be easily 
> overcom,
> but if Juri can fix them I will certainly be a happy user :).

It seems these fundamental issues can't be fixed without changing core 
functions.
The problem is that another window's buffer should be selected before reading
a key sequence in it and executing the bound command.  So the only reliable
alternative is to have global keymaps with tons of commands that use 
with-selected-window.
To make them at least more general that just Help/Info specific, a better 
pattern
would be to base these commands on 'scroll-other-window', e.g.

  (defun forward-char-other-window (&optional n)
    (interactive "P")
    (with-selected-window (other-window-for-scrolling)
      (forward-char n)))

  (defun backward-char-other-window (&optional n)
    (interactive "P")
    (with-selected-window (other-window-for-scrolling)
      (backward-char n)))

  (defun forward-word-other-window (&optional n)
    (interactive "P")
    (with-selected-window (other-window-for-scrolling)
      (forward-word n)))

  (defun backward-word-other-window (&optional n)
    (interactive "P")
    (with-selected-window (other-window-for-scrolling)
      (backward-word n)))

  ...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]