summaryrefslogtreecommitdiff
path: root/lisp/help-macro.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-01-20 14:27:51 +0000
committerRichard M. Stallman <rms@gnu.org>1994-01-20 14:27:51 +0000
commit377240263bd78245d69d527a058794b222534a9d (patch)
tree9adc6fc628d45436af297f255d62fd415e7b2e86 /lisp/help-macro.el
parentc5e550c84c683da458170139309a424f24620c7f (diff)
downloademacs-377240263bd78245d69d527a058794b222534a9d.tar.gz
(make-help-screen): Use overriding-local-map.
Recognize C-v and M-v properly. Compute help-screen after changing the map.
Diffstat (limited to 'lisp/help-macro.el')
-rw-r--r--lisp/help-macro.el30
1 files changed, 15 insertions, 15 deletions
diff --git a/lisp/help-macro.el b/lisp/help-macro.el
index 61fde2c58b2..d168c88896f 100644
--- a/lisp/help-macro.el
+++ b/lisp/help-macro.el
@@ -82,17 +82,16 @@ and then returns."
(, help-text)
(interactive)
(let ((line-prompt
- (substitute-command-keys (, help-line)))
- (help-screen (documentation (quote (, fname)))))
+ (substitute-command-keys (, help-line))))
(message line-prompt)
- (let ((old-local-map (current-local-map))
- (old-global-map (current-global-map))
- (minor-mode-map-alist nil)
- config key char)
+ (let* ((overriding-local-map (make-sparse-keymap))
+ (minor-mode-map-alist nil)
+ config key char help-screen)
(unwind-protect
(progn
- (use-global-map (, helped-map))
- (use-local-map nil)
+ (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 (or (eq char ??) (eq char help-char))
@@ -102,12 +101,15 @@ and then returns."
(erase-buffer)
(insert help-screen)
(goto-char (point-min))
- (while (memq char (cons help-char '(?? ?\C-v ?\ ?\177 ?\M-v)))
+ (while (or (memq char (cons help-char '(?? ?\C-v ?\ ?\177 ?\M-v)))
+ (equal key "\M-v"))
+ (setq list (cons key list))
(condition-case nil
(progn
(if (memq char '(?\C-v ?\ ))
(scroll-up))
- (if (memq char '(?\177 ?\M-v))
+ (if (or (memq char '(?\177 ?\M-v))
+ (equal key "\M-v"))
(scroll-down)))
(error nil))
(message "%s%s: "
@@ -116,7 +118,8 @@ and then returns."
"" " or Space to scroll"))
(let ((cursor-in-echo-area t))
(setq key (read-key-sequence nil)
- char (aref key 0))))))
+ char (aref key 0))))
+ (setq list (cons key list))))
;; Mouse clicks are not part of the help feature,
;; so reexecute them in the standard environment.
(if (listp char)
@@ -130,12 +133,9 @@ and then returns."
(progn
(set-window-configuration config)
(setq config nil)))
- (use-local-map old-local-map)
- (use-global-map old-global-map)
+ (setq overriding-local-map nil)
(call-interactively defn))
(ding)))))
- (use-local-map old-local-map)
- (use-global-map old-global-map)
(if config
(set-window-configuration config))))))
))