From 4a112fd7a6f0dcbd1b99b811b324123f5699bdfb Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 8 Mar 2021 03:29:42 +0100 Subject: Add new face 'help-key-binding' for keybindings in help * lisp/faces.el (help-key-binding): New face. * lisp/help.el (help-for-help): Rename from 'help-for-help-internal'. Use 'substitute-command-keys' syntax. (help): Make into alias for 'help-for-help'. (help-for-help-internal): Make into obsolete alias for 'help-for-help'. (help--key-description-fontified): New function to add the 'help-key-binding' face. (help-key-description, substitute-command-keys) (describe-map-tree, help--describe-command) (help--describe-translation, describe-map): * lisp/help-fns.el (help-fns--key-bindings, describe-mode): Use above new function. * lisp/isearch.el (isearch-help-for-help-internal): Use `substitute-command-keys' syntax. * lisp/help-macro.el (make-help-screen): Use 'substitute-command-keys' and 'help--key-description-fontified'. Simplify. * src/keymap.c (describe_key_maybe_fontify): New function to add the 'help-key-binding' face to keybindings. (describe_vector): Use above new keybinding. (syms_of_keymap) : New DEFSYMs. (fontify_key_properties): New static variable. * lisp/tooltip.el (tooltip-show): Avoid overriding faces in specified tooltip text. * test/lisp/help-tests.el (with-substitute-command-keys-test): Don't test for text properties. (help-tests-substitute-command-keys/add-key-face) (help-tests-substitute-command-keys/add-key-face-listing): New tests. --- lisp/help-macro.el | 224 ++++++++++++++++++++++++++--------------------------- 1 file changed, 111 insertions(+), 113 deletions(-) (limited to 'lisp/help-macro.el') diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 791b10a878f..72371a87278 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -92,119 +92,117 @@ If HELP-TEXT contains the sequence `%THIS-KEY%', that is replaced with the key sequence that invoked FNAME. When FNAME finally does get a command, it executes that command and then returns." - (let ((doc-fn (intern (concat (symbol-name fname) "-doc")))) - `(progn - (defun ,doc-fn () ,help-text nil) - (defun ,fname () - "Help command." - (interactive) - (let ((line-prompt - (substitute-command-keys ,help-line))) - (when three-step-help - (message "%s" line-prompt)) - (let* ((help-screen (documentation (quote ,doc-fn))) - ;; We bind overriding-local-map for very small - ;; sections, *excluding* where we switch buffers - ;; and where we execute the chosen help command. - (local-map (make-sparse-keymap)) - (new-minor-mode-map-alist minor-mode-map-alist) - (prev-frame (selected-frame)) - config new-frame key char) - (when (string-match "%THIS-KEY%" help-screen) - (setq help-screen - (replace-match (key-description - (substring (this-command-keys) 0 -1)) - t t help-screen))) - (unwind-protect - (let ((minor-mode-map-alist nil)) - (setcdr local-map ,helped-map) - (define-key local-map [t] 'undefined) - ;; Make the scroll bar keep working normally. - (define-key local-map [vertical-scroll-bar] - (lookup-key global-map [vertical-scroll-bar])) - (if three-step-help - (progn - (setq key (let ((overriding-local-map local-map)) - (read-key-sequence nil))) - ;; Make the HELP key translate to C-h. - (if (lookup-key function-key-map key) - (setq key (lookup-key function-key-map key))) - (setq char (aref key 0))) - (setq char ??)) - (when (or (eq char ??) (eq char help-char) - (memq char help-event-list)) - (setq config (current-window-configuration)) - (pop-to-buffer " *Metahelp*" nil t) - (and (fboundp 'make-frame) - (not (eq (window-frame) - prev-frame)) - (setq new-frame (window-frame) - config nil)) - (setq buffer-read-only nil) - (let ((inhibit-read-only t)) - (erase-buffer) - (insert help-screen)) - (let ((minor-mode-map-alist new-minor-mode-map-alist)) - (help-mode) - (setq new-minor-mode-map-alist minor-mode-map-alist)) - (goto-char (point-min)) - (while (or (memq char (append help-event-list - (cons help-char '(?? ?\C-v ?\s ?\177 delete backspace vertical-scroll-bar ?\M-v)))) - (eq (car-safe char) 'switch-frame) - (equal key "\M-v")) - (condition-case nil - (cond - ((eq (car-safe char) 'switch-frame) - (handle-switch-frame char)) - ((memq char '(?\C-v ?\s)) - (scroll-up)) - ((or (memq char '(?\177 ?\M-v delete backspace)) - (equal key "\M-v")) - (scroll-down))) - (error nil)) - (let ((cursor-in-echo-area t) - (overriding-local-map local-map)) - (setq key (read-key-sequence - (format "Type one of the options listed%s: " - (if (pos-visible-in-window-p - (point-max)) - "" ", or SPACE or DEL to scroll"))) - char (aref key 0))) - - ;; If this is a scroll bar command, just run it. - (when (eq char 'vertical-scroll-bar) - (command-execute (lookup-key local-map key) nil key)))) - ;; We don't need the prompt any more. - (message "") - ;; Mouse clicks are not part of the help feature, - ;; so reexecute them in the standard environment. - (if (listp char) - (setq unread-command-events - (cons char unread-command-events) - config nil) - (let ((defn (lookup-key local-map key))) - (if defn - (progn - (when config - (set-window-configuration config) - (setq config nil)) - ;; Temporarily rebind `minor-mode-map-alist' - ;; to `new-minor-mode-map-alist' (Bug#10454). - (let ((minor-mode-map-alist new-minor-mode-map-alist)) - ;; `defn' must make sure that its frame is - ;; selected, so we won't iconify it below. - (call-interactively defn)) - (when new-frame - ;; Do not iconify the selected frame. - (unless (eq new-frame (selected-frame)) - (iconify-frame new-frame)) - (setq new-frame nil))) - (ding))))) - (when config - (set-window-configuration config)) - (when new-frame - (iconify-frame new-frame)) - (setq minor-mode-map-alist new-minor-mode-map-alist)))))))) + (declare (indent defun)) + `(defun ,fname () + "Help command." + (interactive) + (let ((line-prompt + (substitute-command-keys ,help-line))) + (when three-step-help + (message "%s" line-prompt)) + (let* ((help-screen ,help-text) + ;; We bind overriding-local-map for very small + ;; sections, *excluding* where we switch buffers + ;; and where we execute the chosen help command. + (local-map (make-sparse-keymap)) + (new-minor-mode-map-alist minor-mode-map-alist) + (prev-frame (selected-frame)) + config new-frame key char) + (when (string-match "%THIS-KEY%" help-screen) + (setq help-screen + (replace-match (help--key-description-fontified + (substring (this-command-keys) 0 -1)) + t t help-screen))) + (unwind-protect + (let ((minor-mode-map-alist nil)) + (setcdr local-map ,helped-map) + (define-key local-map [t] 'undefined) + ;; Make the scroll bar keep working normally. + (define-key local-map [vertical-scroll-bar] + (lookup-key global-map [vertical-scroll-bar])) + (if three-step-help + (progn + (setq key (let ((overriding-local-map local-map)) + (read-key-sequence nil))) + ;; Make the HELP key translate to C-h. + (if (lookup-key function-key-map key) + (setq key (lookup-key function-key-map key))) + (setq char (aref key 0))) + (setq char ??)) + (when (or (eq char ??) (eq char help-char) + (memq char help-event-list)) + (setq config (current-window-configuration)) + (pop-to-buffer " *Metahelp*" nil t) + (and (fboundp 'make-frame) + (not (eq (window-frame) + prev-frame)) + (setq new-frame (window-frame) + config nil)) + (setq buffer-read-only nil) + (let ((inhibit-read-only t)) + (erase-buffer) + (insert (substitute-command-keys help-screen))) + (let ((minor-mode-map-alist new-minor-mode-map-alist)) + (help-mode) + (setq new-minor-mode-map-alist minor-mode-map-alist)) + (goto-char (point-min)) + (while (or (memq char (append help-event-list + (cons help-char '(?? ?\C-v ?\s ?\177 delete backspace vertical-scroll-bar ?\M-v)))) + (eq (car-safe char) 'switch-frame) + (equal key "\M-v")) + (condition-case nil + (cond + ((eq (car-safe char) 'switch-frame) + (handle-switch-frame char)) + ((memq char '(?\C-v ?\s)) + (scroll-up)) + ((or (memq char '(?\177 ?\M-v delete backspace)) + (equal key "\M-v")) + (scroll-down))) + (error nil)) + (let ((cursor-in-echo-area t) + (overriding-local-map local-map)) + (setq key (read-key-sequence + (format "Type one of the options listed%s: " + (if (pos-visible-in-window-p + (point-max)) + "" ", or SPACE or DEL to scroll"))) + char (aref key 0))) + + ;; If this is a scroll bar command, just run it. + (when (eq char 'vertical-scroll-bar) + (command-execute (lookup-key local-map key) nil key)))) + ;; We don't need the prompt any more. + (message "") + ;; Mouse clicks are not part of the help feature, + ;; so reexecute them in the standard environment. + (if (listp char) + (setq unread-command-events + (cons char unread-command-events) + config nil) + (let ((defn (lookup-key local-map key))) + (if defn + (progn + (when config + (set-window-configuration config) + (setq config nil)) + ;; Temporarily rebind `minor-mode-map-alist' + ;; to `new-minor-mode-map-alist' (Bug#10454). + (let ((minor-mode-map-alist new-minor-mode-map-alist)) + ;; `defn' must make sure that its frame is + ;; selected, so we won't iconify it below. + (call-interactively defn)) + (when new-frame + ;; Do not iconify the selected frame. + (unless (eq new-frame (selected-frame)) + (iconify-frame new-frame)) + (setq new-frame nil))) + (ding))))) + (when config + (set-window-configuration config)) + (when new-frame + (iconify-frame new-frame)) + (setq minor-mode-map-alist new-minor-mode-map-alist)))))) (provide 'help-macro) -- cgit v1.2.3 From b6863bd1a683637ee50fece9b715c9b6bde38c7d Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 15 Mar 2021 02:20:23 +0100 Subject: * lisp/help-macro.el: Use lexical-binding. --- lisp/help-macro.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/help-macro.el') diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 72371a87278..81d238305b2 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -1,4 +1,4 @@ -;;; help-macro.el --- makes command line help such as help-for-help +;;; help-macro.el --- makes command line help such as help-for-help -*- lexical-binding: t -*- ;; Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc. -- cgit v1.2.3 From 1fce52813219d325c7c6f758f082009879e2f234 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Apr 2021 15:18:03 +0200 Subject: 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 --- etc/NEWS | 3 + lisp/help-macro.el | 12 +++- lisp/help.el | 163 ++++++++++++++++++++++++++++++++++++----------------- 3 files changed, 124 insertions(+), 54 deletions(-) (limited to 'lisp/help-macro.el') diff --git a/etc/NEWS b/etc/NEWS index e944364499c..0bfe6929295 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -988,6 +988,9 @@ skipped. ** Help +--- +*** The 'help-for-help' ('C-h C-h') screen has been redesigned. + --- *** Keybindings in 'help-mode' use the new 'help-key-binding' face. This face is added by 'substitute-command-keys' to any "\[command]" 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. diff --git a/lisp/help.el b/lisp/help.el index d4be9aa7200..e98f4f2b7eb 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -187,59 +187,120 @@ Do not call this in the scope of `with-help-window'." ;; So keyboard macro definitions are documented correctly (fset 'defining-kbd-macro (symbol-function 'start-kbd-macro)) + +;;; Help for help. (a.k.a. `C-h C-h') + +(defvar help-for-help-buffer-name " *Metahelp*" + "Name of the `help-for-help' buffer.") + +(defface help-for-help-header '((t :height 1.26)) + "Face used for headers in the `help-for-help' buffer." + :group 'help) + +(defun help--for-help-make-commands (commands) + "Create commands for `help-for-help' screen from COMMANDS." + (mapconcat + (lambda (cmd) + (if (listp cmd) + (let ((name (car cmd)) (desc (cadr cmd))) + (concat + " " + (if (string-match (rx string-start "C-" word string-end) name) + ;; `help--key-description-fontified' would convert "C-m" to + ;; "RET" so we can't use it here. + (propertize name 'face 'help-key-binding) + (concat "\\[" name "]")) + (propertize "\t" 'display '(space :align-to 8)) + desc)) + "")) + commands "\n")) + +(defun help--for-help-make-sections (sections) + "Create sections for `help-for-help' screen from SECTIONS." + (mapconcat + (lambda (section) + (let ((title (car section)) (commands (cdr section))) + (concat + "\n\n" + (propertize (car section) 'face 'help-for-help-header) + "\n\n" + (help--for-help-make-commands commands)))) + sections "")) + (defalias 'help 'help-for-help) (make-help-screen help-for-help (purecopy "Type a help option: [abcCdefFgiIkKlLmnprstvw.] C-[cdefmnoptw] or ?") - "You have typed %THIS-KEY%, the help character. Type a Help option: -\(Use SPC or DEL to scroll through this text. Type \\\\[help-quit] to exit the Help command.) - -\\[apropos-command] PATTERN Show commands whose name matches the PATTERN (a list of words - or a regexp). See also \\[apropos]. -\\[describe-bindings] Display all key bindings. -\\[describe-key-briefly] KEYS Display the command name run by the given key sequence. -\\[describe-coding-system] CODING Describe the given coding system, or RET for current ones. -\\[apropos-documentation] PATTERN Show a list of functions, variables, and other items whose - documentation matches the PATTERN (a list of words or a regexp). -\\[view-echo-area-messages] Go to the *Messages* buffer which logs echo-area messages. -\\[describe-function] FUNCTION Display documentation for the given function. -\\[Info-goto-emacs-command-node] COMMAND Show the Emacs manual's section that describes the command. -\\[describe-gnu-project] Display information about the GNU project. -\\[view-hello-file] Display the HELLO file which illustrates various scripts. -\\[info] Start the Info documentation reader: read included manuals. -\\[describe-input-method] METHOD Describe a specific input method, or RET for current. -\\[describe-key] KEYS Display the full documentation for the key sequence. -\\[Info-goto-emacs-key-command-node] KEYS Show the Emacs manual's section for the command bound to KEYS. -\\[view-lossage] Show last 300 input keystrokes (lossage). -\\[describe-language-environment] LANG-ENV Describe a specific language environment, or RET for current. -\\[describe-mode] Display documentation of current minor modes and current major mode, - including their special commands. -\\[view-emacs-news] Display news of recent Emacs changes. -\\[describe-symbol] SYMBOL Display the given function or variable's documentation and value. -\\[finder-by-keyword] TOPIC Find packages matching a given topic keyword. -\\[describe-package] PACKAGE Describe the given Emacs Lisp package. -\\[info-emacs-manual] Display the Emacs manual in Info mode. -\\[info-display-manual] Prompt for a manual and then display it in Info mode. -\\[describe-syntax] Display contents of current syntax table, plus explanations. -\\[info-lookup-symbol] SYMBOL Show the section for the given symbol in the Info manual - for the programming language used in this buffer. -\\[help-with-tutorial] Start the Emacs learn-by-doing tutorial. -\\[describe-variable] VARIABLE Display the given variable's documentation and value. -\\[where-is] COMMAND Display which keystrokes invoke the given command (where-is). -\\[display-local-help] Display any available local help at point in the echo area. - -\\[about-emacs] Information about Emacs. -\\[describe-copying] Emacs copying permission (GNU General Public License). -\\[view-emacs-debugging] Instructions for debugging GNU Emacs. -\\[view-external-packages] External packages and information about Emacs. -\\[view-emacs-FAQ] Emacs FAQ. -C-m How to order printed Emacs manuals. -C-n News of recent Emacs changes. -\\[describe-distribution] Emacs ordering and distribution information. -\\[view-emacs-problems] Info about known Emacs problems. -\\[search-forward-help-for-help] Search forward \"help window\". -\\[view-emacs-todo] Emacs TODO list. -\\[describe-no-warranty] Information on absence of warranty for GNU Emacs." - help-map) + (concat + "\(Type " + (help--key-description-fontified "\s") ; SPC + " or " + (help--key-description-fontified "\d") ; DEL + " to scroll, " + (help--key-description-fontified "\C-s") + " to search, or \\\\[help-quit] to exit.)" + (help--for-help-make-sections + '(("Commands, Keys and Functions" + ("describe-mode" + "Show help for current major and minor modes and their commands") + ("describe-bindings" "Show all key bindings") + ("describe-key" "Show help for key") + ("describe-key-briefly" "Show help for key briefly") + ("where-is" "Show which key runs a specific command") + "" + ("apropos-command" + "Search for commands (see also \\[apropos])") + ("apropos-documentation" + "Search documentation of functions, variables, and other items") + ("describe-function" "Show help for function") + ("describe-variable" "Show help for variable") + ("describe-symbol" "Show help for function or variable")) + ("Manuals" + ("info-emacs-manual" "Show Emacs manual") + ("Info-goto-emacs-command-node" + "Show Emacs manual section for command") + ("Info-goto-emacs-key-command-node" + "Show Emacs manual section for a key sequence") + ("info" "Show all installed manuals") + ("info-display-manual" "Show a specific manual") + ("info-lookup-symbol" "Show description of symbol in pertinent manual")) + ("Other Help Commands" + ("view-external-packages" + "Extending Emacs with external packages") + ("finder-by-keyword" + "Search for Emacs packages (see also \\[list-packages])") + ("describe-package" "Describe a specific Emacs package") + "" + ("help-with-tutorial" "Start the Emacs tutorial") + ("view-echo-area-messages" + "Show recent messages (from echo area)") + ("view-lossage" "Show last 300 input keystrokes (lossage)") + ("display-local-help" "Show local help at point")) + ("Miscellaneous" + ("about-emacs" "About Emacs") + ("view-emacs-FAQ" "Emacs FAQ") + ("C-n" "News of recent changes") + ("view-emacs-problems" "Known problems") + ("view-emacs-debugging" "Debugging Emacs") + "" + ("describe-gnu-project" "About the GNU project") + ("describe-copying" + "Emacs copying permission (GNU General Public License)") + ("describe-distribution" + "Emacs ordering and distribution information") + ("C-m" "Order printed manuals") + ("view-emacs-todo" "Emacs TODO") + ("describe-no-warranty" + "Information on absence of warranty")) + ("Internationalization and Coding Systems" + ("describe-input-method" "Describe input method") + ("describe-coding-system" "Describe coding system") + ("describe-language-environment" + "Describe language environment") + ("describe-syntax" "Show current syntax table") + ("view-hello-file" + "Display the HELLO file illustrating various scripts"))))) + help-map + help-for-help-buffer-name) @@ -885,7 +946,7 @@ current buffer." "Search forward \"help window\"." (interactive) ;; Move cursor to the "help window". - (pop-to-buffer " *Metahelp*") + (pop-to-buffer help-for-help-buffer-name) ;; Do incremental search forward. (isearch-forward nil t)) -- cgit v1.2.3 From a6d40a289e2e177b2b508a3380021f66b16a1d19 Mon Sep 17 00:00:00 2001 From: Gregory Heytings Date: Sun, 25 Apr 2021 13:30:15 +0000 Subject: Fix the handling of the Delete key in help screens. * lisp/help-macro.el (make-help-screen): Handle the Delete key in help screens as in Emacs 23 and earlier. Copyright-paperwork-exempt: yes --- lisp/help-macro.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/help-macro.el') diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 96edeaf4660..7fc128c73a9 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -148,7 +148,7 @@ and then returns." (setq new-minor-mode-map-alist minor-mode-map-alist)) (goto-char (point-min)) (while (or (memq char (append help-event-list - (cons help-char '(?? ?\C-v ?\s ?\177 delete backspace vertical-scroll-bar ?\M-v)))) + (cons help-char '(?? ?\C-v ?\s ?\177 deletechar backspace vertical-scroll-bar ?\M-v)))) (eq (car-safe char) 'switch-frame) (equal key "\M-v")) (condition-case nil @@ -157,7 +157,7 @@ and then returns." (handle-switch-frame char)) ((memq char '(?\C-v ?\s)) (scroll-up)) - ((or (memq char '(?\177 ?\M-v delete backspace)) + ((or (memq char '(?\177 ?\M-v deletechar backspace)) (equal key "\M-v")) (scroll-down))) (error nil)) -- cgit v1.2.3 From 6f9180ecb6cc681fdc55ec7cea80c5d9140e152c Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 25 Apr 2021 16:57:47 +0200 Subject: Add more scroll key bindings to make-help-screen * lisp/help-macro.el (make-help-screen): Add bindings to scroll on , , , . --- lisp/help-macro.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lisp/help-macro.el') diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 7fc128c73a9..6a0e11574c1 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -148,18 +148,23 @@ and then returns." (setq new-minor-mode-map-alist minor-mode-map-alist)) (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)))) + (cons help-char '( ?? ?\C-v ?\s ?\177 deletechar backspace vertical-scroll-bar ?\M-v + next prior up down)))) (eq (car-safe char) 'switch-frame) (equal key "\M-v")) (condition-case nil (cond ((eq (car-safe char) 'switch-frame) (handle-switch-frame char)) - ((memq char '(?\C-v ?\s)) + ((memq char '(?\C-v ?\s next)) (scroll-up)) - ((or (memq char '(?\177 ?\M-v deletechar backspace)) + ((or (memq char '(?\177 ?\M-v deletechar backspace prior)) (equal key "\M-v")) - (scroll-down))) + (scroll-down)) + ((memq char '(down)) + (scroll-up 1)) + ((memq char '(up)) + (scroll-down 1))) (error nil)) (let ((cursor-in-echo-area t) (overriding-local-map local-map)) -- cgit v1.2.3 From 230f90d6e278ac4012ea7fe7fcf5e859c659f717 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 25 Apr 2021 17:33:41 +0200 Subject: * lisp/help-macro.el: Remove stale Change Log. --- lisp/help-macro.el | 6 ------ 1 file changed, 6 deletions(-) (limited to 'lisp/help-macro.el') diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 6a0e11574c1..7fe1fb6c3d0 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -59,12 +59,6 @@ ;;-> (define-key c-mp "\C-h" 'help-for-empire-redistribute-map) ;;-> (define-key c-mp help-character 'help-for-empire-redistribute-map) -;;; Change Log: -;; -;; 22-Jan-1991 Lynn Slater x2048 -;; Last Modified: Mon Oct 1 11:43:52 1990 #3 (Lynn Slater) -;; documented better - ;;; Code: (require 'backquote) -- cgit v1.2.3 From 04266a2cacc0f0705d0d1abaada464b402cc7b07 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 30 Apr 2021 19:30:28 +0200 Subject: Advertise PgUp/PgDn instead of SPC/DEL in help-for-help * lisp/help-macro.el (make-help-screen): * lisp/help.el (help-for-help): Advertise PgUp/PgDn instead of SPC/DEL. --- lisp/help-macro.el | 4 ++-- lisp/help.el | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp/help-macro.el') diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 7fe1fb6c3d0..132530deb3b 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -168,9 +168,9 @@ and then returns." (point-max)) "" (concat ", or " - (help--key-description-fontified "\s") ; SPC + (help--key-description-fontified (kbd "")) " or " - (help--key-description-fontified "\d") ; DEL + (help--key-description-fontified (kbd "")) " to scroll")))) char (aref key 0))) diff --git a/lisp/help.el b/lisp/help.el index 85312a411ad..bd671c3d16b 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -233,9 +233,9 @@ Do not call this in the scope of `with-help-window'." (purecopy "Type a help option: [abcCdefFgiIkKlLmnprstvw.] C-[cdefmnoptw] or ?") (concat "\(Type " - (help--key-description-fontified "\s") ; SPC + (help--key-description-fontified (kbd "")) " or " - (help--key-description-fontified "\d") ; DEL + (help--key-description-fontified (kbd "")) " to scroll, " (help--key-description-fontified "\C-s") " to search, or \\\\[help-quit] to exit.)" -- cgit v1.2.3 From fb44f897d9d6b1cf31961781e70af72eb328b701 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 2 May 2021 12:10:54 +0200 Subject: Bind S-SPC to scroll-down in help-for-help * lisp/help-macro.el (make-help-screen): Bind S-SPC to scroll-down. Thanks to Dmitry Gutov . --- lisp/help-macro.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp/help-macro.el') diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 132530deb3b..3b653c31e48 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -142,7 +142,8 @@ and then returns." (setq new-minor-mode-map-alist minor-mode-map-alist)) (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 + (cons help-char '( ?? ?\C-v ?\s ?\177 ?\M-v ?\S-\s + deletechar backspace vertical-scroll-bar next prior up down)))) (eq (car-safe char) 'switch-frame) (equal key "\M-v")) @@ -152,7 +153,7 @@ and then returns." (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 ?\S-\s deletechar backspace prior)) (equal key "\M-v")) (scroll-down)) ((memq char '(down)) -- cgit v1.2.3 From d0d95d161495585c73f881941beda77352517d34 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 2 May 2021 12:19:59 +0200 Subject: * lisp/help-macro.el: Doc fix. --- lisp/help-macro.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lisp/help-macro.el') diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 3b653c31e48..1fa9d82afd8 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -25,11 +25,12 @@ ;;; Commentary: -;; This file supplies the macro make-help-screen which constructs -;; single character dispatching with browsable help such as that provided -;; by help-for-help. This can be used to make many modes easier to use; for -;; example, the GNU Emacs Empire Tool uses this for every "nested" mode map -;; called from the main mode map. +;; This file supplies the macro `make-help-screen' which constructs +;; single character dispatching with browsable help such as that +;; provided by `help-for-help'. This can be used to make many modes +;; easier to use; for example, the (long-since defunct) GNU Emacs +;; Empire Tool used this for every "nested" mode map called from the +;; main mode map. ;; The name of this package was changed from help-screen.el to ;; help-macro.el in order to fit in a 14-character limit. -- cgit v1.2.3