diff options
author | Jay Belanger <jay.p.belanger@gmail.com> | 2011-06-01 19:09:42 -0500 |
---|---|---|
committer | Jay Belanger <jay.p.belanger@gmail.com> | 2011-06-01 19:09:42 -0500 |
commit | a1c2400f272533e9f5cefa8ce59732c355950fd8 (patch) | |
tree | 993c1a3103ae87768a630f2b67e4697b7d8fd128 /lisp/calc/calc.el | |
parent | 8d009f4aa92f21b53eed6b6d2433e913d8c09647 (diff) | |
download | emacs-a1c2400f272533e9f5cefa8ce59732c355950fd8.tar.gz emacs-a1c2400f272533e9f5cefa8ce59732c355950fd8.tar.bz2 emacs-a1c2400f272533e9f5cefa8ce59732c355950fd8.zip |
* calc/calc.el (calc-kill-stack-buffer): Make sure that the trail
buffer isn't killed before making it current.
Diffstat (limited to 'lisp/calc/calc.el')
-rw-r--r-- | lisp/calc/calc.el | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 41f549cbe2c..55ac412b435 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -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 () |