[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: |
Sun, 26 Sep 2021 18:11:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
martin rudalics <rudalics@gmx.at> writes:
> here.+ (if (get-buffer-window (help-buffer))
> + (let ((help-window (get-buffer-window (help-buffer))))
> + (unless (window-dedicated-p help-window)
>
> Please use an idiom like
>
> (when (get-buffer "*Help*")
> (let ((help-window (get-buffer-window "*Help*")))
> (when help-window
> ...
>
> instead.
I agree, but I don't like to see hardcoded *Help* string all over the place. I
don't think it will change in near future, if ever, but since I have used this
in several places, and plan to suggest some other commands for help buffer, I
think we can abstract it even further into something like this:
#+begin_src emacs-lisp
(defun help-window ()
"Return help-buffer window or nil help-buffer is not currently displayed."
(when (get-buffer "*Help*")
(get-buffer-window (get-buffer "*Help*"))))
(defmacro with-help-buffer (&rest body)
"Execute the forms in BODY with HELP-BUFFER temporarily current.
BODY will be executed onlu if HELP-BUFFER is displayed in a live
window on the screen."
(declare (indent 1) (debug t))
`(when (help-window)
(with-current-buffer (help-buffer)
,@body)))
#+end_src
I see some problems with the latest patch I sent to Eli last night. I don't
understand why it worked last night, but does not work today :), but I have
probably had somewhere some state that I evaled, while I was tested.
I can add those two and rework patch to use them when I am done with it. It
loosk cleaner in those interactive commands.
- 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: 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, Arthur Miller, 2021/09/26
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, martin rudalics, 2021/09/26
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer,
Arthur Miller <=
- RE: [External] : Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Drew Adams, 2021/09/26
- Re: [External] : Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Arthur Miller, 2021/09/26
- RE: [External] : Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Drew Adams, 2021/09/26
- Re: [External] : Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Arthur Miller, 2021/09/26
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, martin rudalics, 2021/09/26
- Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer, Arthur Miller, 2021/09/26
- Exec help commands from other buffer (was bug#36767: 26.1; request: add more quick keys to the *Help* buffer), Arthur Miller, 2021/09/27
- Re: Exec help commands from other buffer (was bug#36767: 26.1; request: add more quick keys to the *Help* buffer), Arthur Miller, 2021/09/27
- 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