diff options
| author | Joakim Verona | 2012-01-23 15:10:06 +0100 |
|---|---|---|
| committer | Joakim Verona | 2012-01-23 15:10:06 +0100 |
| commit | 0322b140eead7c94de7f0f6d19a90bd15690b4eb (patch) | |
| tree | 950c011783cc896d0450084cb5155e54548bfe5b /lisp/calc/calc-units.el | |
| parent | d5114bfea3ea4c37c57e2af0f3b095be9fcd8bac (diff) | |
| parent | cb5850f27c1b4d26957d58e2da2314dd12498671 (diff) | |
| download | emacs-0322b140eead7c94de7f0f6d19a90bd15690b4eb.tar.gz emacs-0322b140eead7c94de7f0f6d19a90bd15690b4eb.zip | |
upstream
Diffstat (limited to 'lisp/calc/calc-units.el')
| -rw-r--r-- | lisp/calc/calc-units.el | 19 |
1 files changed, 10 insertions, 9 deletions
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." | |||
| 415 | 415 | ||
| 416 | (defun math-put-default-units (expr) | 416 | (defun math-put-default-units (expr) |
| 417 | "Put the units in EXPR in the default units table." | 417 | "Put the units in EXPR in the default units table." |
| 418 | (let* ((units (math-get-units expr)) | 418 | (let ((units (math-get-units expr))) |
| 419 | (standard-units (math-get-standard-units expr)) | 419 | (unless (eq units 1) |
| 420 | (let* ((standard-units (math-get-standard-units expr)) | ||
| 420 | (default-units (gethash | 421 | (default-units (gethash |
| 421 | standard-units | 422 | standard-units |
| 422 | math-default-units-table))) | 423 | math-default-units-table))) |
| 423 | (cond | 424 | (cond |
| 424 | ((not default-units) | 425 | ((not default-units) |
| 425 | (puthash standard-units (list units) math-default-units-table)) | 426 | (puthash standard-units (list units) math-default-units-table)) |
| 426 | ((not (equal units (car default-units))) | 427 | ((not (equal units (car default-units))) |
| 427 | (puthash standard-units | 428 | (puthash standard-units |
| 428 | (list units (car default-units)) | 429 | (list units (car default-units)) |
| 429 | math-default-units-table))))) | 430 | math-default-units-table))))))) |
| 430 | 431 | ||
| 431 | 432 | ||
| 432 | (defun calc-convert-units (&optional old-units new-units) | 433 | (defun calc-convert-units (&optional old-units new-units) |