help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Pressing ? does not allow window scrolling through the list of info


From: Yuri Khan
Subject: Re: Pressing ? does not allow window scrolling through the list of info commands
Date: Sat, 8 Jul 2023 01:28:29 +0700

On Fri, 7 Jul 2023 at 13:39, Eli Zaretskii <eliz@gnu.org> wrote:

> > However, what is the reason for that event loop?
>
> The reason is to allow return to the manual with minimal fuss.  As the
> user who invokes "?" is very likely to be a newbie to Emacs, having
> them to deal with buffers and windows at this point is unwise, to say
> the least.

‘help-mode-map’ has ‘q’ bound to ‘quit-window’ and that’s the minimal
fuss way to return from the help window. It also would help build
habits that work with a wide set of buffers in Emacs.

As it is, the user has to build three sets of habits: (1) for the
rudimentary Info-summary modal event loop where SPC scrolls up and
anything else quits; (2) for modes that inherit from special-mode
where SPC scrolls up, DEL and S-SPC scroll down, ‘q’ quits, and all
familiar keys work; and (3) for the full experience editable buffers
where you have to scroll with Page Up/Down and have no notion of
quitting.

> For the same reason, the first screenful displayed by "?" should show
> all of the essential commands, leaving the next screenful to show the
> advanced and more rarely-used ones.
>
> I'm not saying I object to adding more keys to scroll the display
> there, but the simplicity of going back to the manual should be
> preserved.

(Hand-written whitespace-ignoring minimal diff follows. I signed the
paperwork some time ago and it should be valid for now.)

     (defun Info-summary ()
       "Display a brief summary of all Info commands."
       (interactive)
-      (save-window-excursion
         (switch-to-buffer "*Help*")
         (setq buffer-read-only nil)
         (erase-buffer)
         (insert (documentation 'Info-mode))
         (help-mode)
+        (setq-local header-line-format '("Press "
+                                         (:propertize "q" face
help-key-binding)
+                                         " to return to Info"))
         (goto-char (point-min))
-        (let (ch flag)
-          (while (progn (setq flag (not (pos-visible-in-window-p (point-max))))
-                        (message (if flag "Type Space to see more"
-                                   "Type Space to return to Info"))
-                        (if (not (eq ?\s (setq ch (read-event))))
-                            (progn (push ch unread-command-events) nil)
-                          flag))
-            (scroll-up)))
-        (bury-buffer "*Help*"))
+      (message "Press %s to return to Info" (propertize "q" 'face
'help-key-binding))
     )

(That said, for personal use, I bind ‘describe-mode’ to ‘?’ in
‘Info-mode-map’. It displays much the same text, albeit with a long
list of minor modes at the top and their details on the bottom.)



reply via email to

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