From c5a15067e5ac011f41cfe28b3dd89573f7238102 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 8 Jan 2005 05:58:05 +0000 Subject: [PATCH] (calc-settings-file-name): Compare calc-settings-file to user-init-file instead of ~/.emacs. Replace ~/.emacs in a prompt by calc-settings-file. --- lisp/calc/calc-mode.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el index dfc488d49dd..389b52385b6 100644 --- a/lisp/calc/calc-mode.el +++ b/lisp/calc/calc-mode.el @@ -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"))))) -- 2.39.5