changeset 70523:bc300a06815f

(ewoc--set-buffer-bind-dll-let*): Use `with-current-buffer'.
author Thien-Thi Nguyen <ttn@gnuvola.org>
date Mon, 08 May 2006 08:00:38 +0000
parents 4f9cf38bdaa0
children 5bc992d7ffd3
files lisp/emacs-lisp/ewoc.el
diffstat 1 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/ewoc.el	Mon May 08 07:56:14 2006 +0000
+++ b/lisp/emacs-lisp/ewoc.el	Mon May 08 08:00:38 2006 +0000
@@ -221,16 +221,12 @@
 dll will be bound when VARLIST is initialized, but the current
 buffer will *not* have been changed.
 Return value of last form in FORMS."
-  (let ((old-buffer (make-symbol "old-buffer"))
-	(hnd (make-symbol "ewoc")))
-    `(let* ((,old-buffer (current-buffer))
-            (,hnd ,ewoc)
+  (let ((hnd (make-symbol "ewoc")))
+    `(let* ((,hnd ,ewoc)
             (dll (ewoc--dll ,hnd))
             ,@varlist)
-      (set-buffer (ewoc--buffer ,hnd))
-      (unwind-protect
-           (progn ,@forms)
-        (set-buffer ,old-buffer)))))
+       (with-current-buffer (ewoc--buffer ,hnd)
+         ,@forms))))
 
 (defmacro ewoc--set-buffer-bind-dll (ewoc &rest forms)
   `(ewoc--set-buffer-bind-dll-let* ,ewoc nil ,@forms))