changeset 66753:2f681ffeffdf

(math-convert-units): Replace any composite unit by its definition.
author Jay Belanger <jay.p.belanger@gmail.com>
date Wed, 09 Nov 2005 06:01:16 +0000
parents 715b819a0ad8
children d8353e21679e
files lisp/calc/calc-units.el
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calc/calc-units.el	Tue Nov 08 21:38:37 2005 +0000
+++ b/lisp/calc/calc-units.el	Wed Nov 09 06:01:16 2005 +0000
@@ -911,6 +911,11 @@
 (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)))