]> code.delx.au - gnu-emacs/commitdiff
(three-step-help): New option.
authorRichard M. Stallman <rms@gnu.org>
Wed, 26 Jan 1994 20:12:33 +0000 (20:12 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 26 Jan 1994 20:12:33 +0000 (20:12 +0000)
(make-help-screen): Implement that option.
Handle delete function key like DEL.
Don't include the option list in the prompt when displaying
a full window of options.

lisp/help-macro.el

index d168c88896f774a48d10ab889c8e9c3a07e3d637..2e1f88f0a400731c88cfe8f4a09fd3ad414b86c1 100644 (file)
 (provide 'help-macro)
 (require 'backquote)
 
+;;;###autoload
+(defvar three-step-help nil
+  "*Non-nil means give more info about Help command in three steps.
+The three steps are simple prompt, prompt with all options,
+and window listing and describing the options.
+A value of nil means skip the middle step, so that
+\\[help-command] \\[help-command] gives the window that lists the options.")
+
 (defmacro make-help-screen (fname help-line help-text helped-map)
   "Construct help-menu function name FNAME.
 When invoked, FNAME shows HELP-LINE and reads a command using HELPED-MAP.
@@ -83,7 +91,8 @@ and then returns."
           (interactive)
           (let ((line-prompt
                  (substitute-command-keys (, help-line))))
-            (message line-prompt)
+            (if three-step-help
+                (message line-prompt))
             (let* ((overriding-local-map (make-sparse-keymap))
                    (minor-mode-map-alist nil)
                    config key char help-screen)
@@ -92,8 +101,10 @@ and then returns."
                     (setcdr overriding-local-map (, helped-map))
                     (define-key overriding-local-map [t] 'undefined)
                     (setq help-screen (documentation (quote (, fname))))
-                    (setq key (read-key-sequence nil))
-                    (setq char (aref key 0))
+                    (if three-step-help
+                        (setq key (read-key-sequence nil)
+                              char (aref key 0))
+                      (setq char ??))
                     (if (or (eq char ??) (eq char help-char))
                         (progn
                           (setq config (current-window-configuration))
@@ -101,23 +112,23 @@ and then returns."
                           (erase-buffer)
                           (insert help-screen)
                           (goto-char (point-min))
-                          (while (or (memq char (cons help-char '(?? ?\C-v ?\ ?\177 ?\M-v)))
+                          (while (or (memq char (cons help-char '(?? ?\C-v ?\ ?\177 delete ?\M-v)))
                                      (equal key "\M-v"))
                             (setq list (cons key list))
                             (condition-case nil
                                 (progn
                                   (if (memq char '(?\C-v ?\ ))
                                       (scroll-up))
-                                  (if (or (memq char '(?\177 ?\M-v))
+                                  (if (or (memq char '(?\177 ?\M-v delete))
                                           (equal key "\M-v"))
                                       (scroll-down)))
                               (error nil))
-                            (message "%s%s: "
-                                     line-prompt
-                                     (if (pos-visible-in-window-p (point-max))
-                                         "" " or Space to scroll"))
                             (let ((cursor-in-echo-area t))
-                              (setq key (read-key-sequence nil)
+                              (setq key (read-key-sequence
+                                         (format "Type one of the options listed%s: "
+                                                 (if (pos-visible-in-window-p
+                                                      (point-max))
+                                                     "" " or Space to scroll")))
                                     char (aref key 0))))
                           (setq list (cons key list))))
                     ;; Mouse clicks are not part of the help feature,