summaryrefslogtreecommitdiff
path: root/lisp/calc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2016-03-11 13:32:13 -0800
committerJohn Wiegley <johnw@newartisans.com>2016-03-11 13:32:13 -0800
commita934bf445ffaa7920aa1dfea47fe08920bbbc94c (patch)
treedae27dd7ebeb733768ac5091c1c4d6b4749689e1 /lisp/calc
parentb7ad5db04ba068ac9cbcfb9a02291e957d093a32 (diff)
parent620951fe22a6ecc2edc1f78d961f52566a7fe2b6 (diff)
downloademacs-a934bf445ffaa7920aa1dfea47fe08920bbbc94c.tar.gz
emacs-a934bf445ffaa7920aa1dfea47fe08920bbbc94c.tar.bz2
emacs-a934bf445ffaa7920aa1dfea47fe08920bbbc94c.zip
Merge from origin/emacs-25
620951f Fix previous fix of enlarge-/shrink-window 2e78353 * lisp/isearch.el (isearch-define-mode-toggle): Fix toggling logic 66d2717 Complete temperature units in calc-convert-temperature dbb02bf Make sure to use case-sensitive search 8b01e69 Prevent infinite loop on not-well-formed xml. (Bug#16344) 100346a Add the missing test case for the previous patch 5aba61e Use the correct dabbrev expansion
Diffstat (limited to 'lisp/calc')
-rw-r--r--lisp/calc/calc-units.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index 07d9ac90d85..525e3e247d5 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -565,7 +565,12 @@ If COMP or STD is non-nil, put that in the units table instead."
(defun calc-convert-temperature (&optional old-units new-units)
(interactive)
(calc-slow-wrapper
- (let ((expr (calc-top-n 1))
+ (let ((tempunits (delq nil
+ (mapcar
+ (lambda (x)
+ (if (nth 3 x) (car x)))
+ math-standard-units)))
+ (expr (calc-top-n 1))
(uold nil)
(uoldname nil)
unew
@@ -580,15 +585,16 @@ If COMP or STD is non-nil, put that in the units table instead."
(car units)))))
(error "Not a pure temperature expression"))
(math-read-expr
- (setq uoldname (read-string
- "Old temperature units: ")))))))
+ (setq uoldname (completing-read
+ "Old temperature units: "
+ tempunits)))))))
(when (eq (car-safe uold) 'error)
(error "Bad format in units expression: %s" (nth 2 uold)))
(or (math-units-in-expr-p expr nil)
(setq expr (math-mul expr uold)))
(setq defunits (math-get-default-units expr))
(setq unew (or new-units
- (read-string
+ (completing-read
(concat
(if uoldname
(concat "Old temperature units: "
@@ -599,7 +605,8 @@ If COMP or STD is non-nil, put that in the units table instead."
(concat " (default "
defunits
"): ")
- ": ")))))
+ ": "))
+ tempunits)))
(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)))