aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-03-29 22:50:11 +0000
committerStefan Monnier2008-03-29 22:50:11 +0000
commit4a5e18325acc15d065ccff1a70552161cfd6c7b2 (patch)
tree2b16d008ecda615a28fe436d717b359c32b48528
parentd9ce91aecbf87ac6c6ce91e5f0d219cf3e60b15c (diff)
downloademacs-4a5e18325acc15d065ccff1a70552161cfd6c7b2.tar.gz
emacs-4a5e18325acc15d065ccff1a70552161cfd6c7b2.zip
(with-temp-buffer): Assume kill-buffer can change current-buffer.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/subr.el11
2 files changed, 8 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 50d418df4a2..4e1ed6f6996 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12008-03-29 Stefan Monnier <monnier@iro.umontreal.ca> 12008-03-29 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * subr.el (with-temp-buffer): Assume kill-buffer can change cur-buf.
4
3 * textmodes/remember.el (remember-diary-convert-entry): Prefer boundp 5 * textmodes/remember.el (remember-diary-convert-entry): Prefer boundp
4 to with-no-warnings. 6 to with-no-warnings.
5 7
diff --git a/lisp/subr.el b/lisp/subr.el
index b23ca358060..b656d2ed203 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2557,11 +2557,12 @@ See also `with-temp-file' and `with-output-to-string'."
2557 (declare (indent 0) (debug t)) 2557 (declare (indent 0) (debug t))
2558 (let ((temp-buffer (make-symbol "temp-buffer"))) 2558 (let ((temp-buffer (make-symbol "temp-buffer")))
2559 `(let ((,temp-buffer (generate-new-buffer " *temp*"))) 2559 `(let ((,temp-buffer (generate-new-buffer " *temp*")))
2560 (unwind-protect 2560 ;; FIXME: kill-buffer can change current-buffer in some odd cases.
2561 (with-current-buffer ,temp-buffer 2561 (with-current-buffer ,temp-buffer
2562 ,@body) 2562 (unwind-protect
2563 (and (buffer-name ,temp-buffer) 2563 (progn ,@body)
2564 (kill-buffer ,temp-buffer)))))) 2564 (and (buffer-name ,temp-buffer)
2565 (kill-buffer ,temp-buffer)))))))
2565 2566
2566(defmacro with-output-to-string (&rest body) 2567(defmacro with-output-to-string (&rest body)
2567 "Execute BODY, return the text it sent to `standard-output', as a string." 2568 "Execute BODY, return the text it sent to `standard-output', as a string."