diff lisp/calc/calc-units.el @ 98201:1d82f8f9b231

(calc-convert-temperature): Use default units when appropriate.
author Jay Belanger <jay.p.belanger@gmail.com>
date Wed, 17 Sep 2008 02:25:37 +0000
parents 6c9af2bfcfee
children f9165517710c
line wrap: on
line diff
--- a/lisp/calc/calc-units.el	Wed Sep 17 00:55:38 2008 +0000
+++ b/lisp/calc/calc-units.el	Wed Sep 17 02:25:37 2008 +0000
@@ -473,19 +473,19 @@
 	 (setq expr (math-mul expr uold)))
      (setq defunits (math-get-default-units expr))
      (setq unew (or new-units
-		    (math-read-expr
-		     (read-string
-                      (concat
-                       (if uoldname
-                           (concat "Old temperature units: "
-                                   uoldname
-                                   ", new units")
-                         "New temperature units")
-                       (if defunits
-                           (concat " (default "
-                                   defunits
-                                   "): ")
-                         ": "))))))
+                    (read-string
+                     (concat
+                      (if uoldname
+                          (concat "Old temperature units: "
+                                  uoldname
+                                  ", new units")
+                        "New temperature units")
+                      (if defunits
+                          (concat " (default "
+                                  defunits
+                                  "): ")
+                        ": ")))))
+     (setq unew (math-read-expr (if (string= unew "") defunits unew)))
      (when (eq (car-safe unew) 'error)
        (error "Bad format in units expression: %s" (nth 2 unew)))
      (math-put-default-units unew)