From 0ccecc08cd5946f1dd3923d655862d160973f7dd Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Thu, 4 Apr 2013 21:20:35 -0500 Subject: [PATCH] * lisp/calc/calc.el (calc-allow-units-as-numbers): Move declaration. * lisp/calc/calc-units.el (calc-convert-units): Redo conditional. --- lisp/ChangeLog | 4 ++++ lisp/calc/calc-units.el | 6 ++++-- lisp/calc/calc.el | 8 -------- 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 + + * calc/calc-units.el (calc-convert-units): Rewrite conditional. + 2013-04-04 Glenn Morris * 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." -- 2.39.2