aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2008-08-14 05:51:24 +0000
committerMartin Rudalics2008-08-14 05:51:24 +0000
commiteff26424890faa5b3970319e6cdcae939c6d942d (patch)
treef1774abaaa505a1e244da8f6de1209fa9a1e789f
parentc7041c350e1ea171c980cb6f73a96db563c801e6 (diff)
downloademacs-eff26424890faa5b3970319e6cdcae939c6d942d.tar.gz
emacs-eff26424890faa5b3970319e6cdcae939c6d942d.zip
(with-help-window): Return last value in BODY.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/help.el27
2 files changed, 17 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9ef1c2cd618..40dcc23d92f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12008-08-14 Martin Rudalics <rudalics@gmx.at>
2
3 * help.el (with-help-window): Return last value in BODY.
4
12008-08-14 Michael Albinus <michael.albinus@gmx.de> 52008-08-14 Michael Albinus <michael.albinus@gmx.de>
2 6
3 * net/xesam.el (xesam-refresh-entry): Use `save-excursion' in the 7 * net/xesam.el (xesam-refresh-entry): Use `save-excursion' in the
diff --git a/lisp/help.el b/lisp/help.el
index 44e3f707af1..9ab2d77854b 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1207,7 +1207,7 @@ window itself is specified by the variable `help-window'."
1207(defmacro with-help-window (buffer-name &rest body) 1207(defmacro with-help-window (buffer-name &rest body)
1208 "Display buffer BUFFER-NAME in a help window evaluating BODY. 1208 "Display buffer BUFFER-NAME in a help window evaluating BODY.
1209Select help window if the actual value of the user option 1209Select help window if the actual value of the user option
1210`help-window-select' says so." 1210`help-window-select' says so. Return last value in BODY."
1211 (declare (indent 1) (debug t)) 1211 (declare (indent 1) (debug t))
1212 ;; Bind list-of-frames to `frame-list' and list-of-window-tuples to a 1212 ;; Bind list-of-frames to `frame-list' and list-of-window-tuples to a
1213 ;; list of one <window window-buffer window-start window-point> tuple 1213 ;; list of one <window window-buffer window-start window-point> tuple
@@ -1222,23 +1222,22 @@ Select help window if the actual value of the user option
1222 list)) 1222 list))
1223 'no-mini t) 1223 'no-mini t)
1224 list))) 1224 list)))
1225 ;; We set `help-window' to t in order to trigger `help-mode-finish' 1225 ;; Make `help-window' t to trigger `help-mode-finish' to set
1226 ;; to set `help-window' to the actual help window. 1226 ;; `help-window' to the actual help window.
1227 (setq help-window t) 1227 (setq help-window t)
1228 ;; Make `help-window-point-marker' point nowhere (the only place 1228 ;; Make `help-window-point-marker' point nowhere (the only place
1229 ;; where this should be set to a buffer position is within BODY). 1229 ;; where this should be set to a buffer position is within BODY).
1230 (set-marker help-window-point-marker nil) 1230 (set-marker help-window-point-marker nil)
1231 1231 (prog1
1232 (with-output-to-temp-buffer ,buffer-name 1232 ;; Return value returned by `with-output-to-temp-buffer'.
1233 (progn ,@body)) 1233 (with-output-to-temp-buffer ,buffer-name
1234 1234 (progn ,@body))
1235 (when (windowp help-window) 1235 (when (windowp help-window)
1236 ;; Set up help window. 1236 ;; Set up help window.
1237 (help-window-setup list-of-frames list-of-window-tuples)) 1237 (help-window-setup list-of-frames list-of-window-tuples))
1238 1238 ;; Reset `help-window' to nil to avoid confusing future calls of
1239 ;; Reset `help-window' to nil to avoid confusing future calls of 1239 ;; `help-mode-finish' with plain `with-output-to-temp-buffer'.
1240 ;; `help-mode-finish' by "plain" `with-output-to-temp-buffer'. 1240 (setq help-window nil))))
1241 (setq help-window nil)))
1242 1241
1243(provide 'help) 1242(provide 'help)
1244 1243