summaryrefslogtreecommitdiff
path: root/lisp/help-macro.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-04-24 15:18:03 +0200
committerStefan Kangas <stefan@marxist.se>2021-04-24 15:18:03 +0200
commit1fce52813219d325c7c6f758f082009879e2f234 (patch)
treea8904b2bfadbef7e10cef70805cd92a01cd9ee94 /lisp/help-macro.el
parent21b3ceea3b0321559e9cbdcb034d9c66d3264d89 (diff)
downloademacs-1fce52813219d325c7c6f758f082009879e2f234.tar.gz
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.el12
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.