aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2011-02-06 18:54:23 -0600
committerJay Belanger2011-02-06 18:54:23 -0600
commitec6ad6f20a885e8a87f31c4fd2c76d470ae61d12 (patch)
tree48970eb8bffeaa575546b800766583a3ce553688
parentc5aff743c3963a8fdaab628d2b695df50432e0de (diff)
downloademacs-ec6ad6f20a885e8a87f31c4fd2c76d470ae61d12.tar.gz
emacs-ec6ad6f20a885e8a87f31c4fd2c76d470ae61d12.zip
calc/README: Add mention of logarithmic units.
calc/calc-help.el (calc-logunits-add): Rename from `calc-logunits-plus'. (calc-logunits-sub): Rename from `calc-logunits-minus'. (calc-logunits-mul): Rename from `calc-logunits-times'. (calcFunc-lupoweradd): Rename from `calcFunc-lupowerplus'. (calcFunc-lupowersub): Rename from `calcFunc-lupowerminus'. (calcFunc-lupowermul): Rename from `calcFunc-lupowertimes'. calc/calc-ext.el (calc-init-extensions): Change names of logarithmic unit functions in autoloads.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/calc/README2
-rw-r--r--lisp/calc/calc-ext.el16
-rw-r--r--lisp/calc/calc-units.el22
4 files changed, 27 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3d20d7001d6..40f91cfee7e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -13,16 +13,16 @@
13 `math-logunits-level' 13 `math-logunits-level'
14 (math-logunits-plus): Renamed from math-logcombine. 14 (math-logunits-plus): Renamed from math-logcombine.
15 (calcFunc-luplus, calcFunc-luminus calc-luplus, calc-luminus): Remove. 15 (calcFunc-luplus, calcFunc-luminus calc-luplus, calc-luminus): Remove.
16 (calcFunc-lufieldplus, calcFunc-lupowerplus, calcFunc-lufieldminus) 16 (calcFunc-lufieldadd, calcFunc-lupoweradd, calcFunc-lufieldsub)
17 (calcFunc-lufieldminus,calc-logunits-plus calc-logunits-minus): 17 (calcFunc-lufieldsub,calc-logunits-add calc-logunits-sub):
18 New functions. 18 New functions.
19 (calcFunc-fieldquant): Renamed from `calcFunc-fieldlevel'. 19 (calcFunc-fieldquant): Renamed from `calcFunc-fieldlevel'.
20 (calcFunc-powerquant): Renamed from `calcFunc-powerlevel'. 20 (calcFunc-powerquant): Renamed from `calcFunc-powerlevel'.
21 (calc-logunits-quantity): Renamed from `calc-level'. 21 (calc-logunits-quantity): Renamed from `calc-level'.
22 (calcFunc-dbfieldlevel, calcFunc-dbpowerlevel, calcFunc-npfieldlevel) 22 (calcFunc-dbfieldlevel, calcFunc-dbpowerlevel, calcFunc-npfieldlevel)
23 (calcFunc-nppowerlevel,calc-logunits-dblevel, calc-logunits-nplevel) 23 (calcFunc-nppowerlevel,calc-logunits-dblevel, calc-logunits-nplevel)
24 (math-logunits-times, calcFunc-lufieldtimes, calcFunc-lupowertimes) 24 (math-logunits-mul, calcFunc-lufieldmul, calcFunc-lupowermul)
25 (calc-logunits-times, math-logunits-divide, calcFunc-lufielddiv) 25 (calc-logunits-mul, math-logunits-divide, calcFunc-lufielddiv)
26 (calcFunc-lupowerdiv,calc-logunits-divide,math-logunits-level): 26 (calcFunc-lupowerdiv,calc-logunits-divide,math-logunits-level):
27 New functions. 27 New functions.
28 28
@@ -33,6 +33,8 @@
33 33
34 * calc/calc-ext.el (calc-init-extensions): Update autoloads. 34 * calc/calc-ext.el (calc-init-extensions): Update autoloads.
35 35
36 * calc/README: Mention logarithmic units.
37
362011-02-06 Chong Yidong <cyd@stupidchicken.com> 382011-02-06 Chong Yidong <cyd@stupidchicken.com>
37 39
38 * mail/emacsbug.el (report-emacs-bug-hook): Remove the check for 40 * mail/emacsbug.el (report-emacs-bug-hook): Remove the check for
diff --git a/lisp/calc/README b/lisp/calc/README
index e1170fc6df7..533b80baeb0 100644
--- a/lisp/calc/README
+++ b/lisp/calc/README
@@ -72,6 +72,8 @@ Summary of changes to "Calc"
72 72
73Emacs 24.1 73Emacs 24.1
74 74
75* Support for logarithmic units added.
76
75* Calc no longer uses the tex prefix for TeX specific unit 77* Calc no longer uses the tex prefix for TeX specific unit
76names when using TeX or LaTeX mode. 78names when using TeX or LaTeX mode.
77 79
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index d3a9d98d621..fcc3ecc1ab1 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -425,9 +425,9 @@
425 (define-key calc-mode-map "lq" 'calc-logunits-quantity) 425 (define-key calc-mode-map "lq" 'calc-logunits-quantity)
426 (define-key calc-mode-map "ld" 'calc-logunits-dblevel) 426 (define-key calc-mode-map "ld" 'calc-logunits-dblevel)
427 (define-key calc-mode-map "ln" 'calc-logunits-nplevel) 427 (define-key calc-mode-map "ln" 'calc-logunits-nplevel)
428 (define-key calc-mode-map "l+" 'calc-logunits-plus) 428 (define-key calc-mode-map "l+" 'calc-logunits-add)
429 (define-key calc-mode-map "l-" 'calc-logunits-minus) 429 (define-key calc-mode-map "l-" 'calc-logunits-sub)
430 (define-key calc-mode-map "l*" 'calc-logunits-times) 430 (define-key calc-mode-map "l*" 'calc-logunits-mul)
431 (define-key calc-mode-map "l/" 'calc-logunits-divide) 431 (define-key calc-mode-map "l/" 'calc-logunits-divide)
432 (define-key calc-mode-map "l?" 'calc-l-prefix-help) 432 (define-key calc-mode-map "l?" 'calc-l-prefix-help)
433 433
@@ -939,9 +939,9 @@ calc-store-value calc-var-name)
939 ("calc-stuff" calc-explain-why calcFunc-clean 939 ("calc-stuff" calc-explain-why calcFunc-clean
940calcFunc-pclean calcFunc-pfloat calcFunc-pfrac) 940calcFunc-pclean calcFunc-pfloat calcFunc-pfrac)
941 941
942 ("calc-units" calcFunc-usimplify calcFunc-lufieldplus 942 ("calc-units" calcFunc-usimplify calcFunc-lufieldadd
943calcFunc-lupowerplus calcFunc-lufieldminus calcFunc-lupowerminus 943calcFunc-lupoweradd calcFunc-lufieldsub calcFunc-lupowersub
944calcFunc-lufieldtimes calcFunc-lupowertimes calcFunc-lufielddiv 944calcFunc-lufieldmul calcFunc-lupowermul calcFunc-lufielddiv
945calcFunc-lupowerdiv calcFunc-fieldquant calcFunc-powerquant 945calcFunc-lupowerdiv calcFunc-fieldquant calcFunc-powerquant
946calcFunc-dbfieldlevel calcFunc-dbpowerlevel calcFunc-npfieldlevel 946calcFunc-dbfieldlevel calcFunc-dbpowerlevel calcFunc-npfieldlevel
947calcFunc-nppowerlevel 947calcFunc-nppowerlevel
@@ -1177,8 +1177,8 @@ calc-enter-units-table calc-explain-units calc-extract-units
1177calc-get-unit-definition calc-permanent-units calc-quick-units 1177calc-get-unit-definition calc-permanent-units calc-quick-units
1178calc-remove-units calc-simplify-units calc-undefine-unit 1178calc-remove-units calc-simplify-units calc-undefine-unit
1179calc-view-units-table calc-logunits-quantity calc-logunits-dblevel 1179calc-view-units-table calc-logunits-quantity calc-logunits-dblevel
1180calc-logunits-nplevel calc-logunits-plus calc-logunits-minus 1180calc-logunits-nplevel calc-logunits-add calc-logunits-sub
1181calc-logunits-times calc-logunits-divide) 1181calc-logunits-mul calc-logunits-divide)
1182 1182
1183 ("calc-vec" calc-arrange-vector calc-build-vector calc-cnorm 1183 ("calc-vec" calc-arrange-vector calc-build-vector calc-cnorm
1184calc-conj-transpose calc-cons calc-cross calc-kron calc-diag 1184calc-conj-transpose calc-cons calc-cross calc-kron calc-diag
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index c6bcff79765..65b3356b13a 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -1567,7 +1567,7 @@ If EXPR is nil, return nil."
1567 (list '^ (math-extract-logunits (nth 1 expr)) (nth 2 expr)) 1567 (list '^ (math-extract-logunits (nth 1 expr)) (nth 2 expr))
1568 (if (member expr math-logunits) expr 1)))) 1568 (if (member expr math-logunits) expr 1))))
1569 1569
1570(defun math-logunits-plus (a b neg power) 1570(defun math-logunits-add (a b neg power)
1571 (let ((aunit (math-simplify (math-extract-logunits a)))) 1571 (let ((aunit (math-simplify (math-extract-logunits a))))
1572 (if (not (eq (car-safe aunit) 'var)) 1572 (if (not (eq (car-safe aunit) 'var))
1573 (calc-record-why "*Improper logarithmic unit" aunit) 1573 (calc-record-why "*Improper logarithmic unit" aunit)
@@ -1607,18 +1607,18 @@ If EXPR is nil, return nil."
1607 units))))))) 1607 units)))))))
1608 1608
1609(defun calcFunc-lufieldplus (a b) 1609(defun calcFunc-lufieldplus (a b)
1610 (math-logunits-plus a b nil nil)) 1610 (math-logunits-add a b nil nil))
1611 1611
1612(defun calcFunc-lupowerplus (a b) 1612(defun calcFunc-lupowerplus (a b)
1613 (math-logunits-plus a b nil t)) 1613 (math-logunits-add a b nil t))
1614 1614
1615(defun calcFunc-lufieldminus (a b) 1615(defun calcFunc-lufieldminus (a b)
1616 (math-logunits-plus a b t nil)) 1616 (math-logunits-add a b t nil))
1617 1617
1618(defun calcFunc-lupowerminus (a b) 1618(defun calcFunc-lupowerminus (a b)
1619 (math-logunits-plus a b t t)) 1619 (math-logunits-add a b t t))
1620 1620
1621(defun calc-logunits-plus (arg) 1621(defun calc-logunits-add (arg)
1622 (interactive "P") 1622 (interactive "P")
1623 (calc-slow-wrapper 1623 (calc-slow-wrapper
1624 (if (calc-is-inverse) 1624 (if (calc-is-inverse)
@@ -1629,7 +1629,7 @@ If EXPR is nil, return nil."
1629 (calc-binary-op "lu+" 'calcFunc-lufieldplus arg) 1629 (calc-binary-op "lu+" 'calcFunc-lufieldplus arg)
1630 (calc-binary-op "lu+" 'calcFunc-lupowerplus arg))))) 1630 (calc-binary-op "lu+" 'calcFunc-lupowerplus arg)))))
1631 1631
1632(defun calc-logunits-minus (arg) 1632(defun calc-logunits-sub (arg)
1633 (interactive "P") 1633 (interactive "P")
1634 (calc-slow-wrapper 1634 (calc-slow-wrapper
1635 (if (calc-is-inverse) 1635 (if (calc-is-inverse)
@@ -1640,7 +1640,7 @@ If EXPR is nil, return nil."
1640 (calc-binary-op "lu-" 'calcFunc-lufieldminus arg) 1640 (calc-binary-op "lu-" 'calcFunc-lufieldminus arg)
1641 (calc-binary-op "lu-" 'calcFunc-lupowerminus arg))))) 1641 (calc-binary-op "lu-" 'calcFunc-lupowerminus arg)))))
1642 1642
1643(defun math-logunits-times (a b power) 1643(defun math-logunits-mul (a b power)
1644 (let (logunit coef units number) 1644 (let (logunit coef units number)
1645 (cond 1645 (cond
1646 ((and 1646 ((and
@@ -1703,12 +1703,12 @@ If EXPR is nil, return nil."
1703 units))))))))) 1703 units)))))))))
1704 1704
1705(defun calcFunc-lufieldtimes (a b) 1705(defun calcFunc-lufieldtimes (a b)
1706 (math-logunits-times a b nil)) 1706 (math-logunits-mul a b nil))
1707 1707
1708(defun calcFunc-lupowertimes (a b) 1708(defun calcFunc-lupowertimes (a b)
1709 (math-logunits-times a b t)) 1709 (math-logunits-mul a b t))
1710 1710
1711(defun calc-logunits-times (arg) 1711(defun calc-logunits-mul (arg)
1712 (interactive "P") 1712 (interactive "P")
1713 (calc-slow-wrapper 1713 (calc-slow-wrapper
1714 (if (calc-is-inverse) 1714 (if (calc-is-inverse)