aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-07-16 17:58:12 +0000
committerRichard M. Stallman1994-07-16 17:58:12 +0000
commitd536293f4b67398d8e9df1e3f6480588ff3d36fd (patch)
tree76e4bc01d3cca9872ed9d1e0a14fc2de21b18f56
parent7f410bb7ec7304e27626f43520406788da780e4f (diff)
downloademacs-d536293f4b67398d8e9df1e3f6480588ff3d36fd.tar.gz
emacs-d536293f4b67398d8e9df1e3f6480588ff3d36fd.zip
(print-help-return-message): If help buffer is a
special display buffer, say nothing about how to switch back.
-rw-r--r--lisp/help.el44
1 files changed, 34 insertions, 10 deletions
diff --git a/lisp/help.el b/lisp/help.el
index e861bc8e42e..c6585f0e41b 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -136,16 +136,40 @@
136Computes a message and applies the optional argument FUNCTION to it. 136Computes a message and applies the optional argument FUNCTION to it.
137If FUNCTION is nil, applies `message' to it, thus printing it." 137If FUNCTION is nil, applies `message' to it, thus printing it."
138 (and (not (get-buffer-window standard-output)) 138 (and (not (get-buffer-window standard-output))
139 (funcall (or function 'message) 139 (let ((first-message
140 (concat 140 (cond ((or (member (buffer-name standard-output)
141 (substitute-command-keys 141 special-display-buffer-names)
142 (if (one-window-p t) 142 (let (found
143 (if pop-up-windows 143 (tail special-display-regexps)
144 "Type \\[delete-other-windows] to remove help window." 144 (name (buffer-name standard-output)))
145 "Type \\[switch-to-buffer] RET to remove help window.") 145 (while (and tail (not found))
146 "Type \\[switch-to-buffer-other-window] RET to restore the other window.")) 146 (if (string-match (car tail) name)
147 (substitute-command-keys 147 (setq found t))
148 " \\[scroll-other-window] to scroll the help."))))) 148 (setq tail (cdr tail)))
149 found))
150 ;; If the help output buffer is a special display buffer,
151 ;; don't say anything about how to get rid of it.
152 ;; First of all, the user will do that with the window
153 ;; manager, not with Emacs.
154 ;; Secondly, the buffer has not been displayed yet,
155 ;; so we don't know whether its frame will be selected.
156 ;; Even the message about scrolling the help
157 ;; might be wrong, but it seems worth showing it anyway.
158 nil)
159 ((not (one-window-p t))
160 "Type \\[switch-to-buffer-other-window] RET to restore the other window.")
161 (pop-up-windows
162 "Type \\[delete-other-windows] to remove help window.")
163 (t
164 "Type \\[switch-to-buffer] RET to remove help window."))))
165 (funcall (or function 'message)
166 (concat
167 (if first-message
168 (substitute-command-keys first-message)
169 "")
170 (if first-message " " "")
171 (substitute-command-keys
172 "\\[scroll-other-window] to scroll the help."))))))
149 173
150(defun describe-key (key) 174(defun describe-key (key)
151 "Display documentation of the function invoked by KEY. KEY is a string." 175 "Display documentation of the function invoked by KEY. KEY is a string."