diff options
| -rw-r--r-- | lisp/help-macro.el | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/lisp/help-macro.el b/lisp/help-macro.el index d168c88896f..2e1f88f0a40 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el | |||
| @@ -71,6 +71,14 @@ | |||
| 71 | (provide 'help-macro) | 71 | (provide 'help-macro) |
| 72 | (require 'backquote) | 72 | (require 'backquote) |
| 73 | 73 | ||
| 74 | ;;;###autoload | ||
| 75 | (defvar three-step-help nil | ||
| 76 | "*Non-nil means give more info about Help command in three steps. | ||
| 77 | The three steps are simple prompt, prompt with all options, | ||
| 78 | and window listing and describing the options. | ||
| 79 | A value of nil means skip the middle step, so that | ||
| 80 | \\[help-command] \\[help-command] gives the window that lists the options.") | ||
| 81 | |||
| 74 | (defmacro make-help-screen (fname help-line help-text helped-map) | 82 | (defmacro make-help-screen (fname help-line help-text helped-map) |
| 75 | "Construct help-menu function name FNAME. | 83 | "Construct help-menu function name FNAME. |
| 76 | When invoked, FNAME shows HELP-LINE and reads a command using HELPED-MAP. | 84 | When invoked, FNAME shows HELP-LINE and reads a command using HELPED-MAP. |
| @@ -83,7 +91,8 @@ and then returns." | |||
| 83 | (interactive) | 91 | (interactive) |
| 84 | (let ((line-prompt | 92 | (let ((line-prompt |
| 85 | (substitute-command-keys (, help-line)))) | 93 | (substitute-command-keys (, help-line)))) |
| 86 | (message line-prompt) | 94 | (if three-step-help |
| 95 | (message line-prompt)) | ||
| 87 | (let* ((overriding-local-map (make-sparse-keymap)) | 96 | (let* ((overriding-local-map (make-sparse-keymap)) |
| 88 | (minor-mode-map-alist nil) | 97 | (minor-mode-map-alist nil) |
| 89 | config key char help-screen) | 98 | config key char help-screen) |
| @@ -92,8 +101,10 @@ and then returns." | |||
| 92 | (setcdr overriding-local-map (, helped-map)) | 101 | (setcdr overriding-local-map (, helped-map)) |
| 93 | (define-key overriding-local-map [t] 'undefined) | 102 | (define-key overriding-local-map [t] 'undefined) |
| 94 | (setq help-screen (documentation (quote (, fname)))) | 103 | (setq help-screen (documentation (quote (, fname)))) |
| 95 | (setq key (read-key-sequence nil)) | 104 | (if three-step-help |
| 96 | (setq char (aref key 0)) | 105 | (setq key (read-key-sequence nil) |
| 106 | char (aref key 0)) | ||
| 107 | (setq char ??)) | ||
| 97 | (if (or (eq char ??) (eq char help-char)) | 108 | (if (or (eq char ??) (eq char help-char)) |
| 98 | (progn | 109 | (progn |
| 99 | (setq config (current-window-configuration)) | 110 | (setq config (current-window-configuration)) |
| @@ -101,23 +112,23 @@ and then returns." | |||
| 101 | (erase-buffer) | 112 | (erase-buffer) |
| 102 | (insert help-screen) | 113 | (insert help-screen) |
| 103 | (goto-char (point-min)) | 114 | (goto-char (point-min)) |
| 104 | (while (or (memq char (cons help-char '(?? ?\C-v ?\ ?\177 ?\M-v))) | 115 | (while (or (memq char (cons help-char '(?? ?\C-v ?\ ?\177 delete ?\M-v))) |
| 105 | (equal key "\M-v")) | 116 | (equal key "\M-v")) |
| 106 | (setq list (cons key list)) | 117 | (setq list (cons key list)) |
| 107 | (condition-case nil | 118 | (condition-case nil |
| 108 | (progn | 119 | (progn |
| 109 | (if (memq char '(?\C-v ?\ )) | 120 | (if (memq char '(?\C-v ?\ )) |
| 110 | (scroll-up)) | 121 | (scroll-up)) |
| 111 | (if (or (memq char '(?\177 ?\M-v)) | 122 | (if (or (memq char '(?\177 ?\M-v delete)) |
| 112 | (equal key "\M-v")) | 123 | (equal key "\M-v")) |
| 113 | (scroll-down))) | 124 | (scroll-down))) |
| 114 | (error nil)) | 125 | (error nil)) |
| 115 | (message "%s%s: " | ||
| 116 | line-prompt | ||
| 117 | (if (pos-visible-in-window-p (point-max)) | ||
| 118 | "" " or Space to scroll")) | ||
| 119 | (let ((cursor-in-echo-area t)) | 126 | (let ((cursor-in-echo-area t)) |
| 120 | (setq key (read-key-sequence nil) | 127 | (setq key (read-key-sequence |
| 128 | (format "Type one of the options listed%s: " | ||
| 129 | (if (pos-visible-in-window-p | ||
| 130 | (point-max)) | ||
| 131 | "" " or Space to scroll"))) | ||
| 121 | char (aref key 0)))) | 132 | char (aref key 0)))) |
| 122 | (setq list (cons key list)))) | 133 | (setq list (cons key list)))) |
| 123 | ;; Mouse clicks are not part of the help feature, | 134 | ;; Mouse clicks are not part of the help feature, |