summaryrefslogtreecommitdiff
path: root/lisp/calc/calc-ext.el
diff options
context:
space:
mode:
authorJay Belanger <jay.p.belanger@gmail.com>2005-01-09 15:55:08 +0000
committerJay Belanger <jay.p.belanger@gmail.com>2005-01-09 15:55:08 +0000
commit9ab8041d24fe2d1144ccbad3c1644b7f0e7b3576 (patch)
tree67fb2536a12c1e269fdd4469dc1c40a0cf3d5a13 /lisp/calc/calc-ext.el
parent6c8e75541ecd56a6e215e219d3bf697872127b9a (diff)
downloademacs-9ab8041d24fe2d1144ccbad3c1644b7f0e7b3576.tar.gz
(calc-reset): Restore saved values of variables instead of default
values (restore default values with a 0 argument).
Diffstat (limited to 'lisp/calc/calc-ext.el')
-rw-r--r--lisp/calc/calc-ext.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 89588b4ea74..80e801ab2b7 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -1240,20 +1240,22 @@ calc-kill calc-kill-region calc-yank))))
(defun calc-reset (arg)
(interactive "P")
+ (setq arg (if arg (prefix-numeric-value arg) nil))
(save-excursion
(or (eq major-mode 'calc-mode)
(calc-create-buffer))
(if calc-embedded-info
(calc-embedded nil))
- (or arg
- (setq calc-stack nil))
+ (unless (and arg (> (abs arg) 0))
+ (setq calc-stack nil))
(setq calc-undo-list nil
calc-redo-list nil)
(let (calc-stack calc-user-parse-tables calc-standard-date-formats
calc-invocation-macro)
(mapcar (function (lambda (v) (set v nil))) calc-local-var-list)
- (mapcar (function (lambda (v) (set (car v) (nth 1 v))))
- calc-mode-var-list))
+ (if (and arg (<= arg 0))
+ (calc-mode-var-list-restore-default-values)
+ (calc-mode-var-list-restore-saved-values)))
(calc-set-language nil nil t)
(calc-mode)
(calc-flush-caches t)