From 65b62d0acb7efe8012127fa5124c663fa475ce44 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Wed, 9 Nov 2005 06:02:54 +0000 Subject: [PATCH] (math-convert-units): Replace any composite unit by its definition. --- lisp/ChangeLog | 5 +++++ lisp/calc/calc-units.el | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9aa623acaa6..ab6e97dc9e2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2005-11-08 Jay Belanger + + * calc/calc-units.el (math-convert-units): Replace any composite + unit by its definition. + 2005-11-08 Lars Hansen * emacs-lisp/autoload.el (update-directory-autoloads): Add obsolete function alias. 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))) -- 2.39.5