aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/help-macro.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/help-macro.el b/lisp/help-macro.el
index 10453e0505c..ffce7d762e6 100644
--- a/lisp/help-macro.el
+++ b/lisp/help-macro.el
@@ -94,15 +94,19 @@ and then returns."
94 (if three-step-help 94 (if three-step-help
95 (message line-prompt)) 95 (message line-prompt))
96 (let* ((help-screen (documentation (quote (, fname)))) 96 (let* ((help-screen (documentation (quote (, fname))))
97 (overriding-local-map (make-sparse-keymap)) 97 ;; We bind overriding-local-map for very small
98 ;; sections, *excluding* where we switch buffers
99 ;; and where we execute the chosen help command.
100 (local-map (make-sparse-keymap))
98 (minor-mode-map-alist nil) 101 (minor-mode-map-alist nil)
99 config key char) 102 config key char)
100 (unwind-protect 103 (unwind-protect
101 (progn 104 (progn
102 (setcdr overriding-local-map (, helped-map)) 105 (setcdr local-map (, helped-map))
103 (define-key overriding-local-map [t] 'undefined) 106 (define-key local-map [t] 'undefined)
104 (if three-step-help 107 (if three-step-help
105 (setq key (read-key-sequence nil) 108 (setq key (let ((overriding-local-map local-map))
109 (read-key-sequence nil))
106 char (aref key 0)) 110 char (aref key 0))
107 (setq char ??)) 111 (setq char ??))
108 (if (or (eq char ??) (eq char help-char)) 112 (if (or (eq char ??) (eq char help-char))
@@ -122,7 +126,8 @@ and then returns."
122 (equal key "\M-v")) 126 (equal key "\M-v"))
123 (scroll-down))) 127 (scroll-down)))
124 (error nil)) 128 (error nil))
125 (let ((cursor-in-echo-area t)) 129 (let ((cursor-in-echo-area t)
130 (overriding-local-map local-map))
126 (setq key (read-key-sequence 131 (setq key (read-key-sequence
127 (format "Type one of the options listed%s: " 132 (format "Type one of the options listed%s: "
128 (if (pos-visible-in-window-p 133 (if (pos-visible-in-window-p
@@ -135,7 +140,9 @@ and then returns."
135 (setq unread-command-events 140 (setq unread-command-events
136 (cons char unread-command-events) 141 (cons char unread-command-events)
137 config nil) 142 config nil)
138 (let ((defn (key-binding key))) 143 (let ((defn
144 (let ((overriding-local-map local-map))
145 (key-binding key))))
139 (if defn 146 (if defn
140 (progn 147 (progn
141 (if config 148 (if config