diff options
| author | Jay Belanger | 2013-04-04 21:20:35 -0500 |
|---|---|---|
| committer | Jay Belanger | 2013-04-04 21:20:35 -0500 |
| commit | 0ccecc08cd5946f1dd3923d655862d160973f7dd (patch) | |
| tree | 2a47640fb169c30dcc8f9d0efc4521faf1712ad6 | |
| parent | 567d89caf1304c780e3cedc9db4c31a2ce57d588 (diff) | |
| download | emacs-0ccecc08cd5946f1dd3923d655862d160973f7dd.tar.gz 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/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/calc/calc-units.el | 6 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2013-04-05 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc/calc-units.el (calc-convert-units): Rewrite conditional. | ||
| 4 | |||
| 1 | 2013-04-04 Glenn Morris <rgm@gnu.org> | 5 | 2013-04-04 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * electric.el (electric-pair-inhibit-predicate): Add :version. | 7 | * 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." | |||
| 437 | (list new-units (car default-units)) | 437 | (list new-units (car default-units)) |
| 438 | math-default-units-table)))))) | 438 | math-default-units-table)))))) |
| 439 | 439 | ||
| 440 | (defvar calc-allow-units-as-numbers) | 440 | (defvar calc-allow-units-as-numbers t) |
| 441 | 441 | ||
| 442 | (defun calc-convert-units (&optional old-units new-units) | 442 | (defun calc-convert-units (&optional old-units new-units) |
| 443 | (interactive) | 443 | (interactive) |
| @@ -451,7 +451,9 @@ If COMP or STD is non-nil, put that in the units table instead." | |||
| 451 | defunits) | 451 | defunits) |
| 452 | (if (or (not (math-units-in-expr-p expr t)) | 452 | (if (or (not (math-units-in-expr-p expr t)) |
| 453 | (setq unitscancel (and | 453 | (setq unitscancel (and |
| 454 | calc-allow-units-as-numbers | 454 | (if (get 'calc-allow-units-as-numbers 'saved-value) |
| 455 | (car (get 'calc-allow-units-as-numbers 'saved-value)) | ||
| 456 | calc-allow-units-as-numbers) | ||
| 455 | (eq (math-get-standard-units expr) 1)))) | 457 | (eq (math-get-standard-units expr) 1)))) |
| 456 | (let ((uold (or old-units | 458 | (let ((uold (or old-units |
| 457 | (progn | 459 | (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." | |||
| 426 | :version "24.3" | 426 | :version "24.3" |
| 427 | :type 'boolean) | 427 | :type 'boolean) |
| 428 | 428 | ||
| 429 | (defcustom calc-allow-units-as-numbers | ||
| 430 | t | ||
| 431 | "If non-nil, allow unit expressions to be treated like numbers | ||
| 432 | when converting units, if the expression can be simplified to be unitless." | ||
| 433 | :group 'calc | ||
| 434 | :version "24.4" | ||
| 435 | :type 'boolean) | ||
| 436 | |||
| 437 | (defcustom calc-undo-length | 429 | (defcustom calc-undo-length |
| 438 | 100 | 430 | 100 |
| 439 | "The number of undo steps that will be preserved when Calc is quit." | 431 | "The number of undo steps that will be preserved when Calc is quit." |