# HG changeset patch # User Jay Belanger # Date 1105330024 0 # Node ID 00dbe02e6d466caa3f6691a5a3cc401a0fb33844 # Parent 1a855ee4f5fd52d1c46bbf195f4cfcc9e4bd5f67 (calc-mode-var-list-restore-saved-values): Make sure settings file exists before accessing it. diff -r 1a855ee4f5fd -r 00dbe02e6d46 lisp/calc/calc.el --- a/lisp/calc/calc.el Sun Jan 09 22:13:11 2005 +0000 +++ b/lisp/calc/calc.el Mon Jan 10 04:07:04 2005 +0000 @@ -257,15 +257,17 @@ (defun calc-mode-var-list-restore-saved-values () (let ((newvarlist '())) (save-excursion - (let (pos) - (set-buffer (find-file-noselect (substitute-in-file-name - calc-settings-file))) - (goto-char (point-min)) - (when (and (search-forward ";;; Mode settings stored by Calc" nil t) - (progn - (forward-line 1) - (setq pos (point)) - (search-forward "\n;;; End of mode settings" nil t))) + (let (pos + (file (substitute-in-file-name calc-settings-file))) + (when (and + (file-regular-p file) + (set-buffer (find-file-noselect file)) + (goto-char (point-min)) + (search-forward ";;; Mode settings stored by Calc" nil t) + (progn + (forward-line 1) + (setq pos (point)) + (search-forward "\n;;; End of mode settings" nil t))) (beginning-of-line) (calc-mode-var-list-restore-default-values) (eval-region pos (point))