]> code.delx.au - gnu-emacs/blobdiff - lisp/calc/calc.el
* lisp/find-dired.el (find-grep-options): Simplify.
[gnu-emacs] / lisp / calc / calc.el
index 08ae7b101136dd060b5c8a5826a4c729685bc38e..55ac412b435f20b599701915e40a1f4340a2e2ac 100644 (file)
@@ -434,13 +434,13 @@ by displaying the sub-formula in `calc-selected-face'."
   :group 'calc
   :type 'boolean)
 
-(defcustom calc-logunits-field-reference
+(defcustom calc-lu-field-reference
   "20 uPa"
   "The default reference level for logarithmic units (field)."
   :group 'calc
   :type '(string))
 
-(defcustom calc-logunits-power-reference
+(defcustom calc-lu-power-reference
   "mW"
   "The default reference level for logarithmic units (power)."
   :group 'calc
@@ -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 ()