diff options
| author | Jay Belanger | 2012-05-19 09:59:47 -0500 |
|---|---|---|
| committer | Jay Belanger | 2012-05-19 09:59:47 -0500 |
| commit | 76bc2ec7dc90ff0514b090a9801e71a3e92a740a (patch) | |
| tree | 0aa31d57b32c02931cd7a518ccba8e22042d14b6 | |
| parent | 21a8caaa4af24f258e6c7f80c1fc913b00aee044 (diff) | |
| download | emacs-76bc2ec7dc90ff0514b090a9801e71a3e92a740a.tar.gz emacs-76bc2ec7dc90ff0514b090a9801e71a3e92a740a.zip | |
* calc/calc-units.el (math-consistent-units-p): Accept unit systems
as consistent units.
| -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." | |||
| 921 | (math-single-units-in-expr-p (nth 1 expr)))) | 921 | (math-single-units-in-expr-p (nth 1 expr)))) |
| 922 | (t 'wrong))) | 922 | (t 'wrong))) |
| 923 | 923 | ||
| 924 | (defun math-consistent-units-p (expr1 expr2) | 924 | (defun math-consistent-units-p (expr newunits) |
| 925 | "Non-nil if EXPR1 and EXPR2 have consistent units." | 925 | "Non-nil if EXPR and NEWUNITS have consistent units." |
| 926 | (math-numberp (math-get-units (list '/ expr1 expr2)))) | 926 | (or |
| 927 | (and (eq (car-safe newunits) 'var) | ||
| 928 | (assq (nth 1 newunits) math-standard-units-systems)) | ||
| 929 | (math-numberp (math-get-units (list '/ expr newunits))))) | ||
| 927 | 930 | ||
| 928 | (defun math-check-unit-consistency (expr units) | 931 | (defun math-check-unit-consistency (expr units) |
| 929 | "Give an error if EXPR and UNITS do not have consistent units." | 932 | "Give an error if EXPR and UNITS do not have consistent units." |