changeset 59417:8cb9d2c5b48e

(calc-settings-file-name): Compare calc-settings-file to user-init-file instead of ~/.emacs. Replace ~/.emacs in a prompt by calc-settings-file.
author Jay Belanger <jay.p.belanger@gmail.com>
date Sat, 08 Jan 2005 05:58:05 +0000
parents d736a1979b98
children 08f6c11de799
files lisp/calc/calc-mode.el
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calc/calc-mode.el	Sat Jan 08 05:57:11 2005 +0000
+++ b/lisp/calc/calc-mode.el	Sat Jan 08 05:58:05 2005 +0000
@@ -309,25 +309,22 @@
 (defun calc-settings-file-name (name &optional arg)
   (interactive
    (list (read-file-name (format "Settings file name (normally %s): "
-				 (abbreviate-file-name (or user-init-file
-							   "~/.emacs"))))
+				 (abbreviate-file-name calc-settings-file)))
 	 current-prefix-arg))
   (calc-wrapper
    (setq arg (if arg (prefix-numeric-value arg) 0))
-   (if (equal name "")
+   (if (string-equal (file-name-nondirectory name) "")
        (message "Calc settings file is \"%s\"" calc-settings-file)
      (if (< (math-abs arg) 2)
 	 (let ((list calc-mode-var-list))
 	   (while list
 	     (set (car (car list)) (nth 1 (car list)))
 	     (setq list (cdr list)))))
-     ;; FIXME: we should use ~/.calc or so in order to avoid
-     ;; reexecuting ~/.emacs (it's not always idempotent) -cgw 2001.11.12
      (setq calc-settings-file name)
      (or (and
 	  calc-settings-file
-	  (string-match "\\.emacs" calc-settings-file)
-	      (> arg 0))
+          (equal user-init-file calc-settings-file)
+          (> arg 0))
 	 (< arg 0)
 	 (load name t)
 	 (message "New file")))))