summaryrefslogtreecommitdiff
path: root/lisp/calc
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/calc')
-rw-r--r--lisp/calc/README2
-rw-r--r--lisp/calc/calc-ext.el16
-rw-r--r--lisp/calc/calc-units.el22
3 files changed, 21 insertions, 19 deletions
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"
Emacs 24.1
+* Support for logarithmic units added.
+
* Calc no longer uses the tex prefix for TeX specific unit
names when using TeX or LaTeX mode.
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 @@
(define-key calc-mode-map "lq" 'calc-logunits-quantity)
(define-key calc-mode-map "ld" 'calc-logunits-dblevel)
(define-key calc-mode-map "ln" 'calc-logunits-nplevel)
- (define-key calc-mode-map "l+" 'calc-logunits-plus)
- (define-key calc-mode-map "l-" 'calc-logunits-minus)
- (define-key calc-mode-map "l*" 'calc-logunits-times)
+ (define-key calc-mode-map "l+" 'calc-logunits-add)
+ (define-key calc-mode-map "l-" 'calc-logunits-sub)
+ (define-key calc-mode-map "l*" 'calc-logunits-mul)
(define-key calc-mode-map "l/" 'calc-logunits-divide)
(define-key calc-mode-map "l?" 'calc-l-prefix-help)
@@ -939,9 +939,9 @@ calc-store-value calc-var-name)
("calc-stuff" calc-explain-why calcFunc-clean
calcFunc-pclean calcFunc-pfloat calcFunc-pfrac)
- ("calc-units" calcFunc-usimplify calcFunc-lufieldplus
-calcFunc-lupowerplus calcFunc-lufieldminus calcFunc-lupowerminus
-calcFunc-lufieldtimes calcFunc-lupowertimes calcFunc-lufielddiv
+ ("calc-units" calcFunc-usimplify calcFunc-lufieldadd
+calcFunc-lupoweradd calcFunc-lufieldsub calcFunc-lupowersub
+calcFunc-lufieldmul calcFunc-lupowermul calcFunc-lufielddiv
calcFunc-lupowerdiv calcFunc-fieldquant calcFunc-powerquant
calcFunc-dbfieldlevel calcFunc-dbpowerlevel calcFunc-npfieldlevel
calcFunc-nppowerlevel
@@ -1177,8 +1177,8 @@ calc-enter-units-table calc-explain-units calc-extract-units
calc-get-unit-definition calc-permanent-units calc-quick-units
calc-remove-units calc-simplify-units calc-undefine-unit
calc-view-units-table calc-logunits-quantity calc-logunits-dblevel
-calc-logunits-nplevel calc-logunits-plus calc-logunits-minus
-calc-logunits-times calc-logunits-divide)
+calc-logunits-nplevel calc-logunits-add calc-logunits-sub
+calc-logunits-mul calc-logunits-divide)
("calc-vec" calc-arrange-vector calc-build-vector calc-cnorm
calc-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."
(list '^ (math-extract-logunits (nth 1 expr)) (nth 2 expr))
(if (member expr math-logunits) expr 1))))
-(defun math-logunits-plus (a b neg power)
+(defun math-logunits-add (a b neg power)
(let ((aunit (math-simplify (math-extract-logunits a))))
(if (not (eq (car-safe aunit) 'var))
(calc-record-why "*Improper logarithmic unit" aunit)
@@ -1607,18 +1607,18 @@ If EXPR is nil, return nil."
units)))))))
(defun calcFunc-lufieldplus (a b)
- (math-logunits-plus a b nil nil))
+ (math-logunits-add a b nil nil))
(defun calcFunc-lupowerplus (a b)
- (math-logunits-plus a b nil t))
+ (math-logunits-add a b nil t))
(defun calcFunc-lufieldminus (a b)
- (math-logunits-plus a b t nil))
+ (math-logunits-add a b t nil))
(defun calcFunc-lupowerminus (a b)
- (math-logunits-plus a b t t))
+ (math-logunits-add a b t t))
-(defun calc-logunits-plus (arg)
+(defun calc-logunits-add (arg)
(interactive "P")
(calc-slow-wrapper
(if (calc-is-inverse)
@@ -1629,7 +1629,7 @@ If EXPR is nil, return nil."
(calc-binary-op "lu+" 'calcFunc-lufieldplus arg)
(calc-binary-op "lu+" 'calcFunc-lupowerplus arg)))))
-(defun calc-logunits-minus (arg)
+(defun calc-logunits-sub (arg)
(interactive "P")
(calc-slow-wrapper
(if (calc-is-inverse)
@@ -1640,7 +1640,7 @@ If EXPR is nil, return nil."
(calc-binary-op "lu-" 'calcFunc-lufieldminus arg)
(calc-binary-op "lu-" 'calcFunc-lupowerminus arg)))))
-(defun math-logunits-times (a b power)
+(defun math-logunits-mul (a b power)
(let (logunit coef units number)
(cond
((and
@@ -1703,12 +1703,12 @@ If EXPR is nil, return nil."
units)))))))))
(defun calcFunc-lufieldtimes (a b)
- (math-logunits-times a b nil))
+ (math-logunits-mul a b nil))
(defun calcFunc-lupowertimes (a b)
- (math-logunits-times a b t))
+ (math-logunits-mul a b t))
-(defun calc-logunits-times (arg)
+(defun calc-logunits-mul (arg)
(interactive "P")
(calc-slow-wrapper
(if (calc-is-inverse)