]> git.eshelyaron.com Git - emacs.git/commitdiff
(with-output-to-string): Make sure that the temporary buffer gets
authorRomain Francoise <romain@orebokech.com>
Tue, 23 Sep 2008 17:26:40 +0000 (17:26 +0000)
committerRomain Francoise <romain@orebokech.com>
Tue, 23 Sep 2008 17:26:40 +0000 (17:26 +0000)
killed.

lisp/ChangeLog
lisp/subr.el

index 68c237ee0f4e7f30b0b12b661ff0ca9941a69fae..319ec8c2442d740d65f0fafc13df18c62f5f9bc2 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-23  Romain Francoise  <romain@orebokech.com>
+
+       * subr.el (with-output-to-string): Make sure that the temporary
+       buffer gets killed.
+
 2008-09-23  Markus Sauermann <markus@sauermann-consulting.de>  (tiny change)
 
        * emacs-lisp/emacslisp-mode.el (calculate-lisp-indent): Fix
@@ -34,7 +39,7 @@
 
 2008-09-20  David De La Harpe Golden  <david@harpegolden.net>
 
-        * files.el (move-file-to-trash): Avoid recursive trashing if
+       * files.el (move-file-to-trash): Avoid recursive trashing if
        rename-file calls delete-file.
 
 2008-09-20  Glenn Morris  <rgm@gnu.org>
 
 2008-09-17  Jay Belanger  <jay.p.belanger@gmail.com>
 
-       * calc/calc-units.el (calc-convert-temperature):  Use default
+       * calc/calc-units.el (calc-convert-temperature): Use default
        units when appropriate.
 
 2008-09-16  Markus Triska  <markus.triska@gmx.at>
index 2aa802cd03eb0eb788492fbe8a4863f2559378f6..2ce6b234e60a2298478b449c2511e9b41fc5de85 100644 (file)
@@ -2586,12 +2586,13 @@ See also `with-temp-file' and `with-output-to-string'."
   (declare (indent 0) (debug t))
   `(let ((standard-output
          (get-buffer-create (generate-new-buffer-name " *string-output*"))))
-     (let ((standard-output standard-output))
-       ,@body)
-     (with-current-buffer standard-output
-       (prog1
-          (buffer-string)
-        (kill-buffer nil)))))
+     (unwind-protect
+        (progn
+          (let ((standard-output standard-output))
+            ,@body)
+          (with-current-buffer standard-output
+            (buffer-string)))
+       (kill-buffer standard-output))))
 
 (defmacro with-local-quit (&rest body)
   "Execute BODY, allowing quits to terminate BODY but not escape further.