emacs-devel
[Top][All Lists]
Advanced

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

Re: Proposal for an improved `help-for-help'


From: Dmitry Gutov
Subject: Re: Proposal for an improved `help-for-help'
Date: Fri, 30 Apr 2021 23:02:11 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 30.04.2021 20:39, Stefan Kangas wrote:

I really like using SPC/S-SPC for scrolling.

It also works in other programs (even though Shift-Space rarely shows up
in any menus or hints), so it should be helpful to support as well.

I agree it should be added, and as I pointed out in a different reply
that is also more consistent with the binding that already exists in
`special-mode-map'.

However, the `make-help-screen' macro uses (read-key-sequence nil) to
get the key, but when I press S-SPC, that function only returns " ".

Try (read-key-sequence nil), S-SPC in some special mode buffer like Xref, it will return [33554446].

So I think you just need to define that binding in the local map. The below works for me (only in graphical Emacs, though). Not sure what to do with the magic number.

diff --git a/lisp/help-macro.el b/lisp/help-macro.el
index 7fe1fb6c3d..8216ddfeb5 100644
--- a/lisp/help-macro.el
+++ b/lisp/help-macro.el
@@ -112,6 +112,7 @@ make-help-screen
              (let ((minor-mode-map-alist nil))
                (setcdr local-map ,helped-map)
                (define-key local-map [t] 'undefined)
+               (define-key local-map (kbd "S-SPC") 'undefined)
                ;; Make the scroll bar keep working normally.
                (define-key local-map [vertical-scroll-bar]
                  (lookup-key global-map [vertical-scroll-bar]))
@@ -143,6 +144,7 @@ make-help-screen
                  (goto-char (point-min))
                  (while (or (memq char (append help-event-list
(cons help-char '( ?? ?\C-v ?\s ?\177 deletechar backspace vertical-scroll-bar ?\M-v
+                                                                  33554464
next prior up down))))
                             (eq (car-safe char) 'switch-frame)
                             (equal key "\M-v"))
@@ -152,7 +154,7 @@ make-help-screen
                          (handle-switch-frame char))
                         ((memq char '(?\C-v ?\s next))
                          (scroll-up))
- ((or (memq char '(?\177 ?\M-v deletechar backspace prior)) + ((or (memq char '(?\177 ?\M-v deletechar backspace prior 33554464))
                              (equal key "\M-v"))
                          (scroll-down))
                         ((memq char '(down))



reply via email to

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