aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJay Belanger2013-03-07 20:11:25 -0600
committerJay Belanger2013-03-07 20:11:25 -0600
commit6d7ebb726dd39b5e5e9f12e0341a4bb350caf637 (patch)
treeddf2c9be5cf92e827f04016ee61c926fbe7588d3 /lisp
parent36075a19b2d37e38e8258dff2f774a2a3702dc55 (diff)
downloademacs-6d7ebb726dd39b5e5e9f12e0341a4bb350caf637.tar.gz
emacs-6d7ebb726dd39b5e5e9f12e0341a4bb350caf637.zip
* doc/misc/calc.texi (Basic Operations on Units): Fix
cross-reference. * calc/calc-units.el (calc-convert-units): Fix the way that default new units are stored.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/calc/calc-units.el12
2 files changed, 12 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4f24f5b2c8c..c8a4a06f28d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12013-03-08 Jay Belanger <jay.p.belanger@gmail.com>
2
3 * calc/calc-units.el (calc-convert-units): Fix the way that default
4 new units are stored.
5
12013-03-07 Karl Fogel <kfogel@red-bean.com> 62013-03-07 Karl Fogel <kfogel@red-bean.com>
2 7
3 * bookmark.el: Define a face to highlight bookmark names in 8 * bookmark.el: Define a face to highlight bookmark names in
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index b334d7b3b45..335980af4dd 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -503,11 +503,13 @@ If COMP or STD is non-nil, put that in the units table instead."
503 (comp (eq (car-safe units) '+))) 503 (comp (eq (car-safe units) '+)))
504 (unless (or unew std) 504 (unless (or unew std)
505 (error "No units specified")) 505 (error "No units specified"))
506 (let ((res 506 (let* ((noold (and uoldname (not (equal uoldname "1"))))
507 (if std 507 (res
508 (math-simplify-units (math-to-standard-units expr (nth 1 std))) 508 (if std
509 (math-convert-units expr units (and uoldname (not (equal uoldname "1"))))))) 509 (math-simplify-units (math-to-standard-units expr (nth 1 std)))
510 (math-put-default-units res (if comp units)) 510 (math-convert-units expr units noold))))
511 (unless std
512 (math-put-default-units (if noold units res) (if comp units)))
511 (calc-enter-result 1 "cvun" res)))))) 513 (calc-enter-result 1 "cvun" res))))))
512 514
513(defun calc-autorange-units (arg) 515(defun calc-autorange-units (arg)