# HG changeset patch # User Stefan Monnier # Date 1206831011 0 # Node ID c15f559a5ada9101a15a0ebc730396171693759a # Parent 79d7508228c3184fa75a8ef0c09238e20e5527c5 (with-temp-buffer): Assume kill-buffer can change current-buffer. diff -r 79d7508228c3 -r c15f559a5ada lisp/ChangeLog --- a/lisp/ChangeLog Sat Mar 29 22:43:16 2008 +0000 +++ b/lisp/ChangeLog Sat Mar 29 22:50:11 2008 +0000 @@ -1,5 +1,7 @@ 2008-03-29 Stefan Monnier + * subr.el (with-temp-buffer): Assume kill-buffer can change cur-buf. + * textmodes/remember.el (remember-diary-convert-entry): Prefer boundp to with-no-warnings. diff -r 79d7508228c3 -r c15f559a5ada lisp/subr.el --- a/lisp/subr.el Sat Mar 29 22:43:16 2008 +0000 +++ b/lisp/subr.el Sat Mar 29 22:50:11 2008 +0000 @@ -2557,11 +2557,12 @@ (declare (indent 0) (debug t)) (let ((temp-buffer (make-symbol "temp-buffer"))) `(let ((,temp-buffer (generate-new-buffer " *temp*"))) - (unwind-protect - (with-current-buffer ,temp-buffer - ,@body) - (and (buffer-name ,temp-buffer) - (kill-buffer ,temp-buffer)))))) + ;; FIXME: kill-buffer can change current-buffer in some odd cases. + (with-current-buffer ,temp-buffer + (unwind-protect + (progn ,@body) + (and (buffer-name ,temp-buffer) + (kill-buffer ,temp-buffer))))))) (defmacro with-output-to-string (&rest body) "Execute BODY, return the text it sent to `standard-output', as a string."