From dd6f2a637de3c4e91a2633e06344b6a0e3bbac70 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Fri, 20 Jan 2012 18:46:09 -0600 Subject: [PATCH] calc/calc-units.el (math-put-default-units): Don't use "1" as a default unit. --- lisp/ChangeLog | 5 +++++ lisp/calc/calc-units.el | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) 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) -- 2.39.2