From: Jay Belanger Date: Fri, 17 May 2013 02:57:09 +0000 (-0500) Subject: * calc/calc-units.el (math-extract-units): Preserve powers of units. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~229^2~50 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1db165f042ce2cf467013e314c81ecd16d7aa2c9;p=emacs.git * calc/calc-units.el (math-extract-units): Preserve powers of units. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4a060875e3c..531ef52a996 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-05-17 Jay Belanger + + * calc/calc-units.el (math-extract-units): Preserve powers + of units. + 2013-05-17 Leo Liu * subr.el (delete-consecutive-dups): New function. diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 0d6f0b0e535..595d875eb6e 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -1497,10 +1497,8 @@ If COMP or STD is non-nil, put that in the units table instead." ((memq (car-safe expr) '(* /)) (cons (car expr) (mapcar 'math-extract-units (cdr expr)))) - ((and - (eq (car-safe expr) '^) - (math-check-unit-name (nth 1 expr))) - expr) + ((eq (car-safe expr) '^) + (list '^ (math-extract-units (nth 1 expr)) (nth 2 expr))) ((math-check-unit-name expr) expr) (t 1)))