Commit ec6ad6f2 authored by Jay Belanger's avatar Jay Belanger
Browse files

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.
parent c5aff743
......@@ -13,16 +13,16 @@
`math-logunits-level'
(math-logunits-plus): Renamed from math-logcombine.
(calcFunc-luplus, calcFunc-luminus calc-luplus, calc-luminus): Remove.
(calcFunc-lufieldplus, calcFunc-lupowerplus, calcFunc-lufieldminus)
(calcFunc-lufieldminus,calc-logunits-plus calc-logunits-minus):
(calcFunc-lufieldadd, calcFunc-lupoweradd, calcFunc-lufieldsub)
(calcFunc-lufieldsub,calc-logunits-add calc-logunits-sub):
New functions.
(calcFunc-fieldquant): Renamed from `calcFunc-fieldlevel'.
(calcFunc-powerquant): Renamed from `calcFunc-powerlevel'.
(calc-logunits-quantity): Renamed from `calc-level'.
(calcFunc-dbfieldlevel, calcFunc-dbpowerlevel, calcFunc-npfieldlevel)
(calcFunc-nppowerlevel,calc-logunits-dblevel, calc-logunits-nplevel)
(math-logunits-times, calcFunc-lufieldtimes, calcFunc-lupowertimes)
(calc-logunits-times, math-logunits-divide, calcFunc-lufielddiv)
(math-logunits-mul, calcFunc-lufieldmul, calcFunc-lupowermul)
(calc-logunits-mul, math-logunits-divide, calcFunc-lufielddiv)
(calcFunc-lupowerdiv,calc-logunits-divide,math-logunits-level):
New functions.
 
......@@ -33,6 +33,8 @@
 
* calc/calc-ext.el (calc-init-extensions): Update autoloads.
 
* calc/README: Mention logarithmic units.
2011-02-06 Chong Yidong <cyd@stupidchicken.com>
 
* mail/emacsbug.el (report-emacs-bug-hook): Remove the check for
......
......@@ -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.
......
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment