1 |
;; Calculator for GNU Emacs, part II [calc-mode.el] |
;; Calculator for GNU Emacs, part II [calc-mode.el] |
2 |
;; Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc. |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
3 |
;; Written by Dave Gillespie, daveg@synaptics.com. |
;; Written by Dave Gillespie, daveg@synaptics.com. |
4 |
|
|
5 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
320 |
(run-hooks 'calc-mode-save-hook) |
(run-hooks 'calc-mode-save-hook) |
321 |
(insert ";;; End of mode settings\n") |
(insert ";;; End of mode settings\n") |
322 |
(if quiet |
(if quiet |
323 |
(let ((executing-macro "")) ; what a kludge! |
;; FIXME: why is this here? -cgw 2001.11.12 |
324 |
|
(let ((executing-kbd-macro "")) ; what a kludge! |
325 |
(save-buffer)) |
(save-buffer)) |
326 |
(save-buffer)))) |
(save-buffer)))) |
327 |
) |
) |
328 |
|
|
329 |
(defun calc-settings-file-name (name &optional arg) |
(defun calc-settings-file-name (name &optional arg) |
330 |
(interactive "sSettings file name (normally ~/.emacs): \nP") |
(interactive |
331 |
|
(list (read-file-name (format "Settings file name (normally %s): " |
332 |
|
(abbreviate-file-name (or user-init-file |
333 |
|
"~/.emacs")))) |
334 |
|
current-prefix-arg)) |
335 |
(calc-wrapper |
(calc-wrapper |
336 |
(setq arg (if arg (prefix-numeric-value arg) 0)) |
(setq arg (if arg (prefix-numeric-value arg) 0)) |
337 |
(if (equal name "") |
(if (equal name "") |
341 |
(while list |
(while list |
342 |
(set (car (car list)) (nth 1 (car list))) |
(set (car (car list)) (nth 1 (car list))) |
343 |
(setq list (cdr list))))) |
(setq list (cdr list))))) |
344 |
|
;; FIXME: we should use ~/.calc or so in order to avoid |
345 |
|
;; reexecuting ~/.emacs (it's not always idempotent) -cgw 2001.11.12 |
346 |
(setq calc-settings-file name) |
(setq calc-settings-file name) |
347 |
(or (and (string-match "\\.emacs" calc-settings-file) |
(or (and (string-match "\\.emacs" calc-settings-file) |
348 |
(> arg 0)) |
(> arg 0)) |
349 |
(< arg 0) |
(< arg 0) |
350 |
(load name t) |
(load name t) |
351 |
(message "New file")))) |
(message "New file"))))) |
|
) |
|
352 |
|
|
353 |
(defun math-get-modes-vec () |
(defun math-get-modes-vec () |
354 |
(list 'vec |
(list 'vec |