From: Jay Belanger Date: Sat, 21 Jan 2012 00:46:09 +0000 (-0600) Subject: calc/calc-units.el (math-put-default-units): Don't use "1" as a X-Git-Tag: emacs-pretest-24.0.93~97^2~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dd6f2a637de3c4e91a2633e06344b6a0e3bbac70;p=emacs.git calc/calc-units.el (math-put-default-units): Don't use "1" as a default unit. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 58579e18727..40e4a8a844a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-01-21 Jay Belanger + + * calc/calc-units.el (math-put-default-units): Don't use "1" as a + default unit. + 2012-01-21 Glenn Morris * international/mule.el (auto-coding-alist): Add .tbz. diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 8f4c79e3f0a..dcbf845c371 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -415,18 +415,19 @@ If EXPR is nil, return nil." (defun math-put-default-units (expr) "Put the units in EXPR in the default units table." - (let* ((units (math-get-units expr)) - (standard-units (math-get-standard-units expr)) + (let ((units (math-get-units expr))) + (unless (eq units 1) + (let* ((standard-units (math-get-standard-units expr)) (default-units (gethash standard-units math-default-units-table))) - (cond - ((not default-units) - (puthash standard-units (list units) math-default-units-table)) - ((not (equal units (car default-units))) - (puthash standard-units - (list units (car default-units)) - math-default-units-table))))) + (cond + ((not default-units) + (puthash standard-units (list units) math-default-units-table)) + ((not (equal units (car default-units))) + (puthash standard-units + (list units (car default-units)) + math-default-units-table))))))) (defun calc-convert-units (&optional old-units new-units)