diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-04-24 15:18:03 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-04-24 15:18:03 +0200 |
commit | 1fce52813219d325c7c6f758f082009879e2f234 (patch) | |
tree | a8904b2bfadbef7e10cef70805cd92a01cd9ee94 /lisp/help-macro.el | |
parent | 21b3ceea3b0321559e9cbdcb034d9c66d3264d89 (diff) | |
download | emacs-1fce52813219d325c7c6f758f082009879e2f234.tar.gz emacs-1fce52813219d325c7c6f758f082009879e2f234.tar.bz2 emacs-1fce52813219d325c7c6f758f082009879e2f234.zip |
Redesign and improve the help-for-help (C-h C-h) command
* lisp/help.el (help-for-help): Redesign help screen; add sections,
rearrange and reword.
(help-for-help-header): New face.
(help--for-help-make-commands, help--for-help-make-sections): New
functions.
(help-for-help-buffer-name): New variable.
* lisp/help-macro.el (make-help-screen): New optional argument
BUFFER-NAME. Fontify keys.
This change was discussed in:
https://lists.gnu.org/r/emacs-devel/2021-02/msg01695.html
https://lists.gnu.org/r/emacs-devel/2021-03/msg00670.html
https://lists.gnu.org/r/emacs-devel/2021-04/msg00292.html
Diffstat (limited to 'lisp/help-macro.el')
-rw-r--r-- | lisp/help-macro.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 81d238305b2..96edeaf4660 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -83,7 +83,8 @@ gives the window that lists the options." :type 'boolean :group 'help) -(defmacro make-help-screen (fname help-line help-text helped-map) +(defmacro make-help-screen (fname help-line help-text helped-map + &optional buffer-name) "Construct help-menu function name FNAME. When invoked, FNAME shows HELP-LINE and reads a command using HELPED-MAP. If the command is the help character, FNAME displays HELP-TEXT @@ -132,7 +133,7 @@ and then returns." (when (or (eq char ??) (eq char help-char) (memq char help-event-list)) (setq config (current-window-configuration)) - (pop-to-buffer " *Metahelp*" nil t) + (pop-to-buffer (or ,buffer-name " *Metahelp*") nil t) (and (fboundp 'make-frame) (not (eq (window-frame) prev-frame)) @@ -166,7 +167,12 @@ and then returns." (format "Type one of the options listed%s: " (if (pos-visible-in-window-p (point-max)) - "" ", or SPACE or DEL to scroll"))) + "" + (concat ", or " + (help--key-description-fontified "\s") ; SPC + " or " + (help--key-description-fontified "\d") ; DEL + " to scroll")))) char (aref key 0))) ;; If this is a scroll bar command, just run it. |