diff options
author | Jay Belanger <jay.p.belanger@gmail.com> | 2012-05-19 09:59:47 -0500 |
---|---|---|
committer | Jay Belanger <jay.p.belanger@gmail.com> | 2012-05-19 09:59:47 -0500 |
commit | 76bc2ec7dc90ff0514b090a9801e71a3e92a740a (patch) | |
tree | 0aa31d57b32c02931cd7a518ccba8e22042d14b6 /lisp/calc | |
parent | 21a8caaa4af24f258e6c7f80c1fc913b00aee044 (diff) | |
download | emacs-76bc2ec7dc90ff0514b090a9801e71a3e92a740a.tar.gz emacs-76bc2ec7dc90ff0514b090a9801e71a3e92a740a.tar.bz2 emacs-76bc2ec7dc90ff0514b090a9801e71a3e92a740a.zip |
* calc/calc-units.el (math-consistent-units-p): Accept unit systems
as consistent units.
Diffstat (limited to 'lisp/calc')
-rw-r--r-- | lisp/calc/calc-units.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 6d876cf79ba..e5c7b6737fb 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -921,9 +921,12 @@ If EXPR is nil, return nil." (math-single-units-in-expr-p (nth 1 expr)))) (t 'wrong))) -(defun math-consistent-units-p (expr1 expr2) - "Non-nil if EXPR1 and EXPR2 have consistent units." - (math-numberp (math-get-units (list '/ expr1 expr2)))) +(defun math-consistent-units-p (expr newunits) + "Non-nil if EXPR and NEWUNITS have consistent units." + (or + (and (eq (car-safe newunits) 'var) + (assq (nth 1 newunits) math-standard-units-systems)) + (math-numberp (math-get-units (list '/ expr newunits))))) (defun math-check-unit-consistency (expr units) "Give an error if EXPR and UNITS do not have consistent units." |