summaryrefslogtreecommitdiff
path: root/lisp/calc/calc-mode.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2001-11-13 07:29:33 +0000
committerEli Zaretskii <eliz@gnu.org>2001-11-13 07:29:33 +0000
commit26f6427dc85018dc734a34d6387a0b4ebdd3d9e4 (patch)
tree2ae007c94dda77b1f4327e958b261f29b41978d3 /lisp/calc/calc-mode.el
parentaf32d76e49daaabfb4aee0ccdb29d55a14b86c6f (diff)
downloademacs-26f6427dc85018dc734a34d6387a0b4ebdd3d9e4.tar.gz
(calc-settings-file-name): Don't hardcode
"~/.emacs"; use `read-file-name'.
Diffstat (limited to 'lisp/calc/calc-mode.el')
-rw-r--r--lisp/calc/calc-mode.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el
index 334bc3e7de9..5bbb9848449 100644
--- a/lisp/calc/calc-mode.el
+++ b/lisp/calc/calc-mode.el
@@ -1,5 +1,5 @@
;; Calculator for GNU Emacs, part II [calc-mode.el]
-;; Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
;; Written by Dave Gillespie, daveg@synaptics.com.
;; This file is part of GNU Emacs.
@@ -320,13 +320,18 @@
(run-hooks 'calc-mode-save-hook)
(insert ";;; End of mode settings\n")
(if quiet
- (let ((executing-macro "")) ; what a kludge!
+ ;; FIXME: why is this here? -cgw 2001.11.12
+ (let ((executing-kbd-macro "")) ; what a kludge!
(save-buffer))
(save-buffer))))
)
(defun calc-settings-file-name (name &optional arg)
- (interactive "sSettings file name (normally ~/.emacs): \nP")
+ (interactive
+ (list (read-file-name (format "Settings file name (normally %s): "
+ (abbreviate-file-name (or user-init-file
+ "~/.emacs"))))
+ current-prefix-arg))
(calc-wrapper
(setq arg (if arg (prefix-numeric-value arg) 0))
(if (equal name "")
@@ -336,13 +341,14 @@
(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 (string-match "\\.emacs" calc-settings-file)
(> arg 0))
(< arg 0)
(load name t)
- (message "New file"))))
-)
+ (message "New file")))))
(defun math-get-modes-vec ()
(list 'vec