summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Belanger <jay.p.belanger@gmail.com>2013-04-04 21:20:35 -0500
committerJay Belanger <jay.p.belanger@gmail.com>2013-04-04 21:20:35 -0500
commit0ccecc08cd5946f1dd3923d655862d160973f7dd (patch)
tree2a47640fb169c30dcc8f9d0efc4521faf1712ad6
parent567d89caf1304c780e3cedc9db4c31a2ce57d588 (diff)
downloademacs-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.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/calc/calc-units.el6
-rw-r--r--lisp/calc/calc.el8
3 files changed, 8 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8806bc2ac48..015ce23ef8e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2013-04-05 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-units.el (calc-convert-units): Rewrite conditional.
+
2013-04-04 Glenn Morris <rgm@gnu.org>
* electric.el (electric-pair-inhibit-predicate): Add :version.
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
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index db30d53d537..c35e7650254 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -426,14 +426,6 @@ when converting units."
:version "24.3"
:type 'boolean)
-(defcustom calc-allow-units-as-numbers
- t
- "If non-nil, allow unit expressions to be treated like numbers
-when converting units, if the expression can be simplified to be unitless."
- :group 'calc
- :version "24.4"
- :type 'boolean)
-
(defcustom calc-undo-length
100
"The number of undo steps that will be preserved when Calc is quit."