diff options
| author | Jay Belanger | 2005-11-09 06:02:54 +0000 |
|---|---|---|
| committer | Jay Belanger | 2005-11-09 06:02:54 +0000 |
| commit | 65b62d0acb7efe8012127fa5124c663fa475ce44 (patch) | |
| tree | a278ee23186ab334f93d9b6f72954e0041fa7acd /lisp | |
| parent | 675984ede6dc0615150ff8fccf65a72f3a4d7876 (diff) | |
| download | emacs-65b62d0acb7efe8012127fa5124c663fa475ce44.tar.gz emacs-65b62d0acb7efe8012127fa5124c663fa475ce44.zip | |
(math-convert-units): Replace any composite unit by its definition.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/calc/calc-units.el | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9aa623acaa6..ab6e97dc9e2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2005-11-08 Jay Belanger <belanger@truman.edu> | ||
| 2 | |||
| 3 | * calc/calc-units.el (math-convert-units): Replace any composite | ||
| 4 | unit by its definition. | ||
| 5 | |||
| 1 | 2005-11-08 Lars Hansen <larsh@soem.dk> | 6 | 2005-11-08 Lars Hansen <larsh@soem.dk> |
| 2 | * emacs-lisp/autoload.el (update-directory-autoloads): Add | 7 | * emacs-lisp/autoload.el (update-directory-autoloads): Add |
| 3 | obsolete function alias. | 8 | 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).") | |||
| 911 | (defvar math-cu-pure) | 911 | (defvar math-cu-pure) |
| 912 | 912 | ||
| 913 | (defun math-convert-units (expr math-cu-new-units &optional math-cu-pure) | 913 | (defun math-convert-units (expr math-cu-new-units &optional math-cu-pure) |
| 914 | (if (eq (car-safe math-cu-new-units) 'var) | ||
| 915 | (let ((unew (assq (nth 1 math-cu-new-units) | ||
| 916 | (math-build-units-table)))) | ||
| 917 | (if (eq (car-safe (nth 1 unew)) '+) | ||
| 918 | (setq math-cu-new-units (nth 1 unew))))) | ||
| 914 | (math-with-extra-prec 2 | 919 | (math-with-extra-prec 2 |
| 915 | (let ((compat (and (not math-cu-pure) | 920 | (let ((compat (and (not math-cu-pure) |
| 916 | (math-find-compatible-unit expr math-cu-new-units))) | 921 | (math-find-compatible-unit expr math-cu-new-units))) |