aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJay Belanger2005-01-08 05:58:05 +0000
committerJay Belanger2005-01-08 05:58:05 +0000
commitc5a15067e5ac011f41cfe28b3dd89573f7238102 (patch)
tree2c7ecb13aec82c48340f87e470efca44a41c86be /lisp
parentfcda0a6649a68af8c18bb789190a39480a92dcb1 (diff)
downloademacs-c5a15067e5ac011f41cfe28b3dd89573f7238102.tar.gz
emacs-c5a15067e5ac011f41cfe28b3dd89573f7238102.zip
(calc-settings-file-name): Compare calc-settings-file to
user-init-file instead of ~/.emacs. Replace ~/.emacs in a prompt by calc-settings-file.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/calc/calc-mode.el11
1 files 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 @@
309(defun calc-settings-file-name (name &optional arg) 309(defun calc-settings-file-name (name &optional arg)
310 (interactive 310 (interactive
311 (list (read-file-name (format "Settings file name (normally %s): " 311 (list (read-file-name (format "Settings file name (normally %s): "
312 (abbreviate-file-name (or user-init-file 312 (abbreviate-file-name calc-settings-file)))
313 "~/.emacs"))))
314 current-prefix-arg)) 313 current-prefix-arg))
315 (calc-wrapper 314 (calc-wrapper
316 (setq arg (if arg (prefix-numeric-value arg) 0)) 315 (setq arg (if arg (prefix-numeric-value arg) 0))
317 (if (equal name "") 316 (if (string-equal (file-name-nondirectory name) "")
318 (message "Calc settings file is \"%s\"" calc-settings-file) 317 (message "Calc settings file is \"%s\"" calc-settings-file)
319 (if (< (math-abs arg) 2) 318 (if (< (math-abs arg) 2)
320 (let ((list calc-mode-var-list)) 319 (let ((list calc-mode-var-list))
321 (while list 320 (while list
322 (set (car (car list)) (nth 1 (car list))) 321 (set (car (car list)) (nth 1 (car list)))
323 (setq list (cdr list))))) 322 (setq list (cdr list)))))
324 ;; FIXME: we should use ~/.calc or so in order to avoid
325 ;; reexecuting ~/.emacs (it's not always idempotent) -cgw 2001.11.12
326 (setq calc-settings-file name) 323 (setq calc-settings-file name)
327 (or (and 324 (or (and
328 calc-settings-file 325 calc-settings-file
329 (string-match "\\.emacs" calc-settings-file) 326 (equal user-init-file calc-settings-file)
330 (> arg 0)) 327 (> arg 0))
331 (< arg 0) 328 (< arg 0)
332 (load name t) 329 (load name t)
333 (message "New file"))))) 330 (message "New file")))))