aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/help-macro.el63
1 files changed, 39 insertions, 24 deletions
diff --git a/lisp/help-macro.el b/lisp/help-macro.el
index 04699ae3875..d12db10a270 100644
--- a/lisp/help-macro.el
+++ b/lisp/help-macro.el
@@ -81,30 +81,45 @@ from the HELPED-MAP and the corresponding interactive function is executed."
81 (let ((line-prompt 81 (let ((line-prompt
82 (substitute-command-keys (, help-line)))) 82 (substitute-command-keys (, help-line))))
83 (message line-prompt) 83 (message line-prompt)
84 (let ((char (read-char))) 84 (let ((char (read-event))
85 (if (or (= char ??) (= char help-char)) 85 config)
86 (save-window-excursion 86 (unwind-protect
87 (switch-to-buffer-other-window "*Help*") 87 (progn
88 (erase-buffer) 88 (if (or (eq char ??) (eq char help-char))
89 (insert (documentation (quote (, fname)))) 89 (progn
90 (goto-char (point-min)) 90 (setq config (current-window-configuration))
91 (while (memq char (cons help-char '(?? ?\C-v ?\ ?\177 ?\M-v))) 91 (switch-to-buffer-other-window "*Help*")
92 (if (memq char '(?\C-v ?\ )) 92 (erase-buffer)
93 (scroll-up)) 93 (insert (documentation (quote (, fname))))
94 (if (memq char '(?\177 ?\M-v)) 94 (goto-char (point-min))
95 (scroll-down)) 95 (while (memq char (cons help-char '(?? ?\C-v ?\ ?\177 ?\M-v)))
96 (message "%s%s: " 96 (if (memq char '(?\C-v ?\ ))
97 line-prompt 97 (scroll-up))
98 (if (pos-visible-in-window-p (point-max)) 98 (if (memq char '(?\177 ?\M-v))
99 "" " or Space to scroll")) 99 (scroll-down))
100 (let ((cursor-in-echo-area t)) 100 (message "%s%s: "
101 (setq char (read-char)))))) 101 line-prompt
102 (let ((defn (cdr (assq (downcase char) (, helped-map))))) 102 (if (pos-visible-in-window-p (point-max))
103 (if defn 103 "" " or Space to scroll"))
104 (if (keymapp defn) 104 (let ((cursor-in-echo-area t))
105 (error "sorry, this command cannot be run from the help screen. Start over.") 105 (setq char (read-event))))))
106 (call-interactively defn)) 106
107 (ding)))))) 107 (let ((defn (cdr (assq (if (integerp char) (downcase char) char) (, helped-map)))))
108 (if defn
109 (if (keymapp defn)
110 (error "sorry, this command cannot be run from the help screen. Start over.")
111 (if config
112 (progn
113 (set-window-configuration config)
114 (setq config nil)))
115 (call-interactively defn))
116 (if (listp char)
117 (setq unread-command-events
118 (cons char unread-command-events)
119 config nil)
120 (ding)))))
121 (if config
122 (set-window-configuration config))))))
108 )) 123 ))
109 124
110;;; help-macro.el 125;;; help-macro.el