diff options
| author | Jay Belanger | 2007-12-31 02:40:18 +0000 |
|---|---|---|
| committer | Jay Belanger | 2007-12-31 02:40:18 +0000 |
| commit | a34f800f0225c82bbc9676c8f3282b63336ec566 (patch) | |
| tree | e8d8e591a337dbb607c179588641d72571615add | |
| parent | a271e124f4800e22a58efbf2fd001dafeb3101cc (diff) | |
| download | emacs-a34f800f0225c82bbc9676c8f3282b63336ec566.tar.gz emacs-a34f800f0225c82bbc9676c8f3282b63336ec566.zip | |
(calc-convert-temperature): Ensure that units are on the result
even when the result is zero.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/calc/calc-units.el | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 35163804e3a..5a645e75e3c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-12-31 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc/calc-units.el (calc-convert-temperature): Ensure that units | ||
| 4 | are on the result even when the result is zero. | ||
| 5 | |||
| 1 | 2007-12-30 Michael Albinus <michael.albinus@gmx.de> | 6 | 2007-12-30 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * net/dbus.el (dbus-name-owner-changed-handler): Make the function | 8 | * net/dbus.el (dbus-name-owner-changed-handler): Make the function |
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index a7c4b20e30d..ac1c0cd0080 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el | |||
| @@ -491,9 +491,14 @@ If EXPR is nil, return nil." | |||
| 491 | (when (eq (car-safe unew) 'error) | 491 | (when (eq (car-safe unew) 'error) |
| 492 | (error "Bad format in units expression: %s" (nth 2 unew))) | 492 | (error "Bad format in units expression: %s" (nth 2 unew))) |
| 493 | (math-put-default-units unew) | 493 | (math-put-default-units unew) |
| 494 | (calc-enter-result 1 "cvtm" (math-simplify-units | 494 | (let ((ntemp (calc-normalize |
| 495 | (math-convert-temperature expr uold unew | 495 | (math-simplify-units |
| 496 | uoldname)))))) | 496 | (math-convert-temperature expr uold unew |
| 497 | uoldname))))) | ||
| 498 | (if (Math-zerop ntemp) | ||
| 499 | (setq ntemp (list '* ntemp unew))) | ||
| 500 | (let ((calc-simplify-mode 'none)) | ||
| 501 | (calc-enter-result 1 "cvtm" ntemp)))))) | ||
| 497 | 502 | ||
| 498 | (defun calc-remove-units () | 503 | (defun calc-remove-units () |
| 499 | (interactive) | 504 | (interactive) |