+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.
(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)
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
: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."