]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/calc/calc.el (calc-allow-units-as-numbers): Move declaration.
authorJay Belanger <jay.p.belanger@gmail.com>
Fri, 5 Apr 2013 02:20:35 +0000 (21:20 -0500)
committerJay Belanger <jay.p.belanger@gmail.com>
Fri, 5 Apr 2013 02:20:35 +0000 (21:20 -0500)
* lisp/calc/calc-units.el (calc-convert-units): Redo conditional.

lisp/ChangeLog
lisp/calc/calc-units.el
lisp/calc/calc.el

index 8806bc2ac48cf8933a5f75702eb9d9c1e0091dc3..015ce23ef8e7065739e9c8ca46c13a2ef99663a1 100644 (file)
@@ -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.
index 335980af4dd7f79e07c1d9ff3f7a4d3f0e31187b..0d6f0b0e535df30a33fd9e30eb9a60102c6650a7 100644 (file)
@@ -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
index db30d53d537af87157356af0339db204af006743..c35e7650254b2ca015ecfa658b49e545785ce26b 100644 (file)
@@ -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."