[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer
From: |
Arthur Miller |
Subject: |
Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer |
Date: |
Fri, 24 Sep 2021 22:33:26 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Juri Linkov <juri@linkov.net> writes:
>> I came up with another idea last night and sent a patch, but I am not sure
>> if it
>> got to right place, I don't see it myself. It was an answer longer in the
>> thread
>> to Lars.
>>
>> This one makes it possible to run any command in *Help* buffer, not just
>> those
>> defined in help-mode.el, and those not need any patching or wrapping of
>> existing
>> commands.
>>
>> I don't know if it is correct place to put define-key for the global map,
>> and I
>> am not sure if C-h M-h is the right, but that's just a detail.
>
> This would be a nice command. But why it's limited only to help-window?
> It could allow reading and running the key sequences in any next-window.
>
>> +(defun help-do-command ()
>> + "Run a key-sequence in \"*Help*\" buffer from other buffers.
>> +
>> +If *Help* buffer is not visible, the HELP-DO-COMMAND will be aborterd."
>> + (interactive)
>> + (if (get-buffer-window (help-buffer))
>
> I meant to replace '(get-buffer-window (help-buffer))' with '(next-window)'.
>
>> + (let ((__key (read-key-sequence "Run command in *Help* buffer: ")))
>> + (with-current-buffer (help-buffer)
>> + (call-interactively
>> + (key-binding
>> + (kbd (edmacro-format-keys (vector last-input-event)))))))
>> + (call-interactively (global-key-binding "\C-g"))))
>> +
>> +(define-key global-map (kbd "C-h M-h") 'help-do-command)
I tried with next-window, but does it give me current-buffers window when there
are no other windows? When there are two windows, it works fine.
#+begin_src emacs-lisp
(defun remote-control-other-window ()
(interactive)
(let ((buffer (window-buffer (next-window))))
(if (and buffer (get-buffer-window buffer))
(progn
(read-key-sequence (format "Run command in %s buffer: "
(buffer-name buffer)))
(with-current-buffer buffer
(call-interactively
(key-binding
(kbd (edmacro-format-keys (vector last-input-event)))))))
(keyboard-quit))))
#+end_src
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, (continued)
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Eli Zaretskii, 2021/09/25
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Arthur Miller, 2021/09/25
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Eli Zaretskii, 2021/09/25
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Arthur Miller, 2021/09/25
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Eli Zaretskii, 2021/09/25
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Arthur Miller, 2021/09/25
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Eli Zaretskii, 2021/09/25
- RE: [External] : Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Drew Adams, 2021/09/24
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Arthur Miller, 2021/09/24
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Arthur Miller, 2021/09/24
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer,
Arthur Miller <=
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Juri Linkov, 2021/09/25