From ec6ad6f20a885e8a87f31c4fd2c76d470ae61d12 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sun, 6 Feb 2011 18:54:23 -0600 Subject: [PATCH] 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. --- lisp/ChangeLog | 10 ++++++---- lisp/calc/README | 2 ++ lisp/calc/calc-ext.el | 16 ++++++++-------- lisp/calc/calc-units.el | 22 +++++++++++----------- 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 @@ `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 * 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" 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) -- 2.39.5