# HG changeset patch # User Jay Belanger # Date 1131516076 0 # Node ID 2f681ffeffdfac206feed5d59d0e27176a9c0f38 # Parent 715b819a0ad856140a17e61e5e2a2fcc3d418ebe (math-convert-units): Replace any composite unit by its definition. diff -r 715b819a0ad8 -r 2f681ffeffdf lisp/calc/calc-units.el --- 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)))