diff options
author | Jay Belanger <jay.p.belanger@gmail.com> | 2005-11-09 06:02:54 +0000 |
---|---|---|
committer | Jay Belanger <jay.p.belanger@gmail.com> | 2005-11-09 06:02:54 +0000 |
commit | 65b62d0acb7efe8012127fa5124c663fa475ce44 (patch) | |
tree | a278ee23186ab334f93d9b6f72954e0041fa7acd /lisp/calc/calc-units.el | |
parent | 675984ede6dc0615150ff8fccf65a72f3a4d7876 (diff) | |
download | emacs-65b62d0acb7efe8012127fa5124c663fa475ce44.tar.gz |
(math-convert-units): Replace any composite unit by its definition.
Diffstat (limited to 'lisp/calc/calc-units.el')
-rw-r--r-- | lisp/calc/calc-units.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index c1673508897..c4b1127a5c5 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -911,6 +911,11 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).") (defvar math-cu-pure) (defun math-convert-units (expr math-cu-new-units &optional math-cu-pure) + (if (eq (car-safe math-cu-new-units) 'var) + (let ((unew (assq (nth 1 math-cu-new-units) + (math-build-units-table)))) + (if (eq (car-safe (nth 1 unew)) '+) + (setq math-cu-new-units (nth 1 unew))))) (math-with-extra-prec 2 (let ((compat (and (not math-cu-pure) (math-find-compatible-unit expr math-cu-new-units))) |