]> git.eshelyaron.com Git - emacs.git/commitdiff
(calc-convert-temperature): Use default units when appropriate.
authorJay Belanger <jay.p.belanger@gmail.com>
Wed, 17 Sep 2008 02:25:37 +0000 (02:25 +0000)
committerJay Belanger <jay.p.belanger@gmail.com>
Wed, 17 Sep 2008 02:25:37 +0000 (02:25 +0000)
lisp/calc/calc-units.el

index 9ada7e31e347df4ba57bb06704816bb9942afdde..8ba6465e9025415c9dde05497d37faa35a64e9a7 100644 (file)
@@ -473,19 +473,19 @@ If EXPR is nil, return nil."
         (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)