diff lisp/calc/calc-units.el @ 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 fffcb2d302a5
children 6bf177f8065b 7beb78bc1f8e
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)))