aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-03-16 04:10:19 +0000
committerRichard M. Stallman1998-03-16 04:10:19 +0000
commit01364a75fb1378ada7c267e2aa78ebd1a786c1cb (patch)
tree11b4736d8e4d0f79c295f83bfc164bdc8bf9558b
parentd98558102b0a82edaed4f6e86f9ec28ed86ddd7e (diff)
downloademacs-01364a75fb1378ada7c267e2aa78ebd1a786c1cb.tar.gz
emacs-01364a75fb1378ada7c267e2aa78ebd1a786c1cb.zip
(help-mode-maybe): Set view-return-to-alist.
(help-return-method): New variable. (print-help-return-message): Set help-return-method.
-rw-r--r--lisp/help.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 86c2f75b852..41f8470fa20 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -129,7 +129,9 @@ Commands:
129 129
130(defun help-mode-maybe () 130(defun help-mode-maybe ()
131 (if (eq major-mode 'fundamental-mode) 131 (if (eq major-mode 'fundamental-mode)
132 (help-mode))) 132 (help-mode))
133 (setq view-return-to-alist
134 (list (cons (selected-window) help-return-method))))
133 135
134(add-hook 'temp-buffer-show-hook 'help-mode-maybe) 136(add-hook 'temp-buffer-show-hook 'help-mode-maybe)
135 137
@@ -228,6 +230,13 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
228 key-desc 230 key-desc
229 (if (symbolp defn) defn (prin1-to-string defn))))))))) 231 (if (symbolp defn) defn (prin1-to-string defn)))))))))
230 232
233(defvar help-return-method nil
234 "What to do to \"exit\" the help buffer.
235This is a list
236 (WINDOW . t) delete the selected window, go to WINDOW.
237 (WINDOW . quit-window) do quit-window, then select WINDOW.
238 (WINDOW BUF START POINT) display BUF at START, POINT, then select WINDOW.")
239
231(defun print-help-return-message (&optional function) 240(defun print-help-return-message (&optional function)
232 "Display or return message saying how to restore windows after help command. 241 "Display or return message saying how to restore windows after help command.
233Computes a message and applies the optional argument FUNCTION to it. 242Computes a message and applies the optional argument FUNCTION to it.
@@ -235,6 +244,7 @@ If FUNCTION is nil, applies `message' to it, thus printing it."
235 (and (not (get-buffer-window standard-output)) 244 (and (not (get-buffer-window standard-output))
236 (let ((first-message 245 (let ((first-message
237 (cond ((special-display-p (buffer-name standard-output)) 246 (cond ((special-display-p (buffer-name standard-output))
247 (setq help-return-method (cons (selected-window) t))
238 ;; If the help output buffer is a special display buffer, 248 ;; If the help output buffer is a special display buffer,
239 ;; don't say anything about how to get rid of it. 249 ;; don't say anything about how to get rid of it.
240 ;; First of all, the user will do that with the window 250 ;; First of all, the user will do that with the window
@@ -243,10 +253,16 @@ If FUNCTION is nil, applies `message' to it, thus printing it."
243 ;; so we don't know whether its frame will be selected. 253 ;; so we don't know whether its frame will be selected.
244 nil) 254 nil)
245 ((not (one-window-p t)) 255 ((not (one-window-p t))
256 (setq help-return-method
257 (cons (selected-window) 'quit-window))
246 "Type \\[switch-to-buffer-other-window] RET to restore the other window.") 258 "Type \\[switch-to-buffer-other-window] RET to restore the other window.")
247 (pop-up-windows 259 (pop-up-windows
260 (setq help-return-method (cons (selected-window) t))
248 "Type \\[delete-other-windows] to remove help window.") 261 "Type \\[delete-other-windows] to remove help window.")
249 (t 262 (t
263 (setq help-return-method
264 (list (selected-window) (window-buffer)
265 (window-start) (window-point)))
250 "Type \\[switch-to-buffer] RET to remove help window.")))) 266 "Type \\[switch-to-buffer] RET to remove help window."))))
251 (funcall (or function 'message) 267 (funcall (or function 'message)
252 (concat 268 (concat