]> git.eshelyaron.com Git - emacs.git/commitdiff
* calc/calc.el (calc-kill-stack-buffer): Make sure that the trail
authorJay Belanger <jay.p.belanger@gmail.com>
Thu, 2 Jun 2011 00:09:42 +0000 (19:09 -0500)
committerJay Belanger <jay.p.belanger@gmail.com>
Thu, 2 Jun 2011 00:09:42 +0000 (19:09 -0500)
  buffer isn't killed before making it current.

lisp/ChangeLog
lisp/calc/calc.el

index 71d927e9692b611cc5b0dc75cc6ed551203dd306..92b125dd1b0114977c40d73aebc9b53d6f229caa 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-02  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc.el (calc-kill-stack-buffer): Make sure that the trail
+       buffer isn't killed before making it current.
+
 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        Silence various byte-compiler warnings.
index 41f549cbe2c9e92dc66634f66d7e854708195213..55ac412b435f20b599701915e40a1f4340a2e2ac 100644 (file)
@@ -1293,19 +1293,20 @@ the trail buffer."
     (if (not info-list)
         (progn
           (setq calc-buffer-list (delete cb calc-buffer-list))
-          (with-current-buffer calc-trail-buffer
-            (if (eq cb calc-main-buffer)
-                ;; If there are other Calc stacks, make another one
-                ;; the calc-main-buffer ...
-                (if calc-buffer-list
-                    (setq calc-main-buffer (car calc-buffer-list))
-                  ;; ... otherwise kill the trail and its windows.
-                  (let ((wl (get-buffer-window-list calc-trail-buffer)))
-                    (while wl
-                      (delete-window (car wl))
-                      (setq wl (cdr wl))))
-                  (kill-buffer calc-trail-buffer)
-                  (setq calc-trail-buffer nil))))
+          (if (buffer-live-p calc-trail-buffer)
+              (with-current-buffer calc-trail-buffer
+                (if (eq cb calc-main-buffer)
+                    ;; If there are other Calc stacks, make another one
+                    ;; the calc-main-buffer ...
+                    (if calc-buffer-list
+                        (setq calc-main-buffer (car calc-buffer-list))
+                      ;; ... otherwise kill the trail and its windows.
+                      (let ((wl (get-buffer-window-list calc-trail-buffer)))
+                        (while wl
+                          (delete-window (car wl))
+                          (setq wl (cdr wl))))
+                      (kill-buffer calc-trail-buffer)))))
+          (setq calc-trail-buffer nil)
           t))))
 
 (defun calc-mode ()