diff options
author | Jay Belanger <jay.p.belanger@gmail.com> | 2013-04-04 21:20:35 -0500 |
---|---|---|
committer | Jay Belanger <jay.p.belanger@gmail.com> | 2013-04-04 21:20:35 -0500 |
commit | 0ccecc08cd5946f1dd3923d655862d160973f7dd (patch) | |
tree | 2a47640fb169c30dcc8f9d0efc4521faf1712ad6 /lisp/calc/calc-units.el | |
parent | 567d89caf1304c780e3cedc9db4c31a2ce57d588 (diff) | |
download | emacs-0ccecc08cd5946f1dd3923d655862d160973f7dd.tar.gz emacs-0ccecc08cd5946f1dd3923d655862d160973f7dd.tar.bz2 emacs-0ccecc08cd5946f1dd3923d655862d160973f7dd.zip |
* lisp/calc/calc.el (calc-allow-units-as-numbers): Move declaration.
* lisp/calc/calc-units.el (calc-convert-units): Redo conditional.
Diffstat (limited to 'lisp/calc/calc-units.el')
-rw-r--r-- | lisp/calc/calc-units.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 335980af4dd..0d6f0b0e535 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -437,7 +437,7 @@ If COMP or STD is non-nil, put that in the units table instead." (list new-units (car default-units)) math-default-units-table)))))) -(defvar calc-allow-units-as-numbers) +(defvar calc-allow-units-as-numbers t) (defun calc-convert-units (&optional old-units new-units) (interactive) @@ -451,7 +451,9 @@ If COMP or STD is non-nil, put that in the units table instead." defunits) (if (or (not (math-units-in-expr-p expr t)) (setq unitscancel (and - calc-allow-units-as-numbers + (if (get 'calc-allow-units-as-numbers 'saved-value) + (car (get 'calc-allow-units-as-numbers 'saved-value)) + calc-allow-units-as-numbers) (eq (math-get-standard-units expr) 1)))) (let ((uold (or old-units (progn |