This gives us a clean build for the new calc package.
* xemacs-packages/calc/calcalg3.el (toplevel): defvar
'calc-graph-no-auto-view', 'math-infinite-mode' for byte-compiler
happiness.
* xemacs-packages/calc/calcalg2.el (calcFunc-table): Wrap 'vec',
'var-DUMMY' in #'with-boundp.
(math-poly-all-roots): Comment out unused local var, 'res'.
* xemacs-packages/calc/calc.el (top-level): defalias 'read-event'
to 'next-event'.
(calc-read-key-sequence): Wrap 'input-method-function' use in
#'with-boundp.
(calc-mode): #'declare-boundp 'calc-menu'
* xemacs-packages/calc/calc-units.el (calc-convert-units): Comment
out unused local var, 'unew'.
* xemacs-packages/calc/calc-trail.el (top-level):
#'globally-declare-boundp 'math-save-buf'.
* xemacs-packages/calc/calc-rewr.el (math-rewrite-whole): Move the
definition to _before_ where it is first used and magically
byte-compiler warning disappears.
* xemacs-packages/calc/calc-prog.el (top-level): Autoload
'edmacro-format-keys', 'edmacro-parse-keys'.
(calc-user-define-permanent): Comment out unused local var, 'pt'.
* xemacs-packages/calc/calc-nlfit.el (top-level):
#'globally-declare-boundp 'calc-curve-nvars'
* xemacs-packages/calc/calc-misc.el
(reporter-prompt-for-summary-p): Defvar it to appease the
byte-compiler gods.
* xemacs-packages/calc/calc-math.el (math-nth-root-float): Add
missing arg in call to #'math-use-emacs-fn.
* xemacs-packages/calc/calc-macs.el (top-level): Autoload
'math-compare'.
* xemacs-packages/calc/calc-help.el (top-level): Autoload
'Info-mode', 'Info-last'.
* xemacs-packages/calc/calc-graph.el (calc-graph-plot): Comment
out unused local var, 'tempbuftop'.
(calc-graph-view): #'declare-fboundp `window-full-height-p'
* xemacs-packages/calc/calc-forms.el (math-setup-year-holidays):
Wrap 'var-m', 'var-y' in #'with-boundp.
(top-level): Autoload 'dst-in-effect',
'calendar-current-time-zone', 'calendar-absolute-from-gregorian'.
* xemacs-packages/calc/calc-ext.el (calc-init-extensions): Add
'math-read-expr-level', 'math-min-list', 'math-max-list',
'math-format-twos-complement', 'math-to-percentsigns',
'math-compose-vector', 'math-compose-var',
'math-tex-expr-is-flat', 'calc-embedded-finish-command',
'calc-embedded-mode-line-change', 'calc-embedded-modes-change',
'calc-embedded-preserve-modes', 'calc-embedded-select-buffer',
'calc-embedded-var-change', 'calc-embedded-stack-change',
'calc-embedded-save-original-modes', 'calc-graph-add-curve',
'calc-graph-set-styles', 'calc-graph-lookup',
'calc-incomplete-error', 'math-parse-fortran-subscr',
'math-bigfr-to-calcnum', 'calc-fit-hubbert-linear-curve',
'calc-push-list-in-macro', 'calc-pop-stack-in-macro',
'calc-top-selected', 'calc-fit-s-shaped-logistic-curve',
'calc-fit-bell-shaped-logistic-curve', 'calc-edit-finish'.
(calc-embedded-quiet): defvar to keep byte-compiler from
bitching.
(math-exp-pos,math-exp-keep-spaces): Ditto.
(math-read-big-expr): Comment out unused vars,
'math-read-big-baseline', 'math-read-big-h2'
(math-read-big-bigp): Wrap use of 'mach-rb-h2' in #'with-boundp
for byte-compile peace and tranquility.
* xemacs-packages/calc/calc-embed.el (top-level): Autoload
#'thing-at-point-looking-at
(calc-do-embedded): Comment out unused local var,
'calc-embedded-no-reselect'.
* xemacs-packages/calc/calc-aent.el (calc-do-alg-entry): Comment
out unused local var, 'calc-buffer'.
* xemacs-packages/calc/Makefile (MAINTAINER): Jay!
(REQUIRES): Add calc, fsf-compat, calendar, mail-lib
(ELCS): Tidy
(EXTRA_SOURCES): New. Add ChangeLog.old, LICENSE
(EXTRA_TEXI_FILES): New. gpl.texi
(DATA_DEST): Set to $(PACKAGE)
(PRELOADS): Remove calc.el, add calc-ext.el
Signed-off-by: Steve Youngs <steve@sxemacs.org>
VERSION = 1.5
AUTHOR_VERSION = 2.2
-MAINTAINER = XEmacs Development Team <xemacs-beta@xemacs.org>
+MAINTAINER = Jay Belanger <belanger@sxemacs.org>
PACKAGE = calc
PKG_TYPE = regular
-REQUIRES = xemacs-base
+REQUIRES = calc xemacs-base fsf-compat calendar mail-lib
CATEGORY = standard
ELCS = calc-macs.elc calc.elc calc-aent.elc calcalg2.elc calcalg3.elc \
calc-forms.elc calc-frac.elc calc-funcs.elc calc-graph.elc \
calc-help.elc calc-incom.elc calc-keypd.elc calc-lang.elc \
calc-map.elc calc-math.elc calc-menu.elc calc-misc.elc \
- calc-mode.elc calc-mtx.elc calc-nlfit.elc calc-poly.elc calc-prog.elc calc-rewr.elc \
- calc-rules.elc calcsel2.elc calc-sel.elc calc-stat.elc \
- calc-store.elc calc-stuff.elc calc-trail.elc calc-undo.elc \
- calc-units.elc calc-vec.elc calc-yank.elc
+ calc-mode.elc calc-mtx.elc calc-nlfit.elc calc-poly.elc \
+ calc-prog.elc calc-rewr.elc calc-rules.elc calcsel2.elc \
+ calc-sel.elc calc-stat.elc calc-store.elc calc-stuff.elc \
+ calc-trail.elc calc-undo.elc calc-units.elc calc-vec.elc \
+ calc-yank.elc
+
+EXTRA_SOURCES = ChangeLog.old LICENSE
DOCS_TEXINFO_EXTENSION = t
STANDARD_DOCS = t
+EXTRA_TEXI_FILES = gpl.texi
+
DATA_FILES = calccard.tex
-DATA_DEST = .
+DATA_DEST = $(PACKAGE)
-PRELOADS = -l calc-macs.el -l calc.el
+PRELOADS = -l calc-macs.el -l calc-ext.el
include ../../XEmacs.rules
;;;###autoload
(defun calc-do-alg-entry (&optional initial prompt no-normalize history)
- (let* ((calc-buffer (current-buffer))
-; (blink-matching-check-function 'calcAlg-blink-matching-check)
+ (let* (;; (calc-buffer (current-buffer)) -- appears unused --SY.
+ ;; (blink-matching-check-function 'calcAlg-blink-matching-check)
(calc-alg-exp 'error))
(if (eq calc-algebraic-mode 'total)
nil
(require 'calc-ext)
(require 'calc-macs)
-
+(autoload 'thing-at-point-looking-at "thingatpt")
(defun calc-show-plain (n)
(error (nth 2 (aref info 8)))))
(let ((mode-line-buffer-identification mode-line-buffer-identification)
(calc-embedded-info info)
- (calc-embedded-no-reselect t))
+ ;; (calc-embedded-no-reselect t) ; appears unused --SY
+ )
(calc-wrapper
(let* (;(okay nil)
(calc-no-refresh-evaltos t))
calcFunc-xfit math-find-minimum math-find-root math-ninteg-evaluate
math-ninteg-midpoint math-ninteg-romberg math-poly-interp)
+ ("calc-aent" math-read-expr-level math-read-factor)
+
("calc-arith" calcFunc-abs calcFunc-abssqr
calcFunc-add calcFunc-ceil calcFunc-decr calcFunc-deven calcFunc-dimag
calcFunc-dint calcFunc-div calcFunc-dnatnum calcFunc-dneg
math-neg-float math-okay-neg math-possible-signs math-possible-types
math-pow-fancy math-pow-mod math-pow-of-zero math-pow-zero
math-quarter-integer math-round math-setup-declarations math-sqr
-math-sqr-float math-trunc-fancy math-trunc-special)
+math-sqr-float math-trunc-fancy math-trunc-special math-min-list
+math-max-list)
("calc-bin" calcFunc-and calcFunc-ash
calcFunc-clip calcFunc-diff calcFunc-lsh calcFunc-not calcFunc-or
calcFunc-rash calcFunc-rot calcFunc-rsh calcFunc-xor math-clip
math-compute-max-digits math-convert-radix-digits math-float-parts
math-format-binary math-format-radix math-format-radix-float math-integer-log2
-math-power-of-2 math-radix-float-power)
+math-power-of-2 math-radix-float-power math-format-twos-complement)
("calc-comb" calc-report-prime-test
calcFunc-choose calcFunc-dfact calcFunc-egcd calcFunc-fact
calcFunc-cheight calcFunc-cwidth math-comp-ascent math-comp-descent
math-comp-height math-comp-width math-compose-expr
math-composition-to-string math-stack-value-offset-fancy
-math-vector-is-string math-vector-to-string)
+math-vector-is-string math-vector-to-string math-to-percentsigns
+math-compose-vector math-compose-var math-tex-expr-is-flat)
("calc-cplx" calcFunc-arg calcFunc-conj
calcFunc-im calcFunc-polar calcFunc-re calcFunc-rect math-complex
("calc-embed" calc-do-embedded
calc-do-embedded-activate calc-embedded-evaluate-expr
-calc-embedded-modes-change calc-embedded-var-change
-calc-embedded-preserve-modes)
+calc-embedded-finish-command calc-embedded-mode-line-change
+calc-embedded-modes-change calc-embedded-preserve-modes
+calc-embedded-select-buffer calc-embedded-var-change
+calc-embedded-stack-change calc-embedded-save-original-modes)
("calc-fin" calc-to-percentage calcFunc-ddb
calcFunc-fv calcFunc-fvb calcFunc-fvl calcFunc-irr calcFunc-irrb
calcFunc-utpf calcFunc-utpn calcFunc-utpp calcFunc-utpt
math-bernoulli-number math-gammap1-raw)
- ("calc-graph" calc-graph-show-tty)
+ ("calc-graph" calc-graph-show-tty calc-graph-add-curve
+calc-graph-set-styles calc-graph-lookup)
- ("calc-incom" calc-digit-dots)
+ ("calc-incom" calc-digit-dots calc-incomplete-error)
("calc-keypd" calc-do-keypad
calc-keypad-x-left-click calc-keypad-x-middle-click
calc-keypad-x-right-click)
- ("calc-lang" calc-set-language
-math-read-big-balance math-read-big-rec)
+ ("calc-lang" calc-set-language math-read-big-balance
+math-read-big-rec math-parse-fortran-subscr)
("calc-map" calc-get-operator calcFunc-accum
calcFunc-afixp calcFunc-anest calcFunc-apply calcFunc-call
math-isqrt math-ln-raw math-nearly-equal math-nearly-equal-float
math-nearly-zerop math-nearly-zerop-float math-nth-root
math-sin-cos-raw math-sin-raw math-sqrt math-sqrt-float math-sqrt-raw
-math-tan-raw math-to-radians math-to-radians-2 math-use-emacs-fn)
+math-tan-raw math-to-radians math-to-radians-2 math-use-emacs-fn
+math-bigfr-to-calcnum)
("calc-mode" math-get-modes-vec)
+ ("calc-nlfit" calc-fit-hubbert-linear-curve)
+
("calc-poly" calcFunc-apart calcFunc-expand
calcFunc-expandpow calcFunc-factor calcFunc-factors calcFunc-nrat
calcFunc-pcont calcFunc-pdeg calcFunc-pdiv calcFunc-pdivide
calcFunc-refers calcFunc-rmeq calcFunc-typeof calcFunc-variable
math-body-refers-to math-break math-composite-inequalities
math-do-defmath math-handle-for math-handle-foreach
-math-normalize-logical-op math-return)
+math-normalize-logical-op math-return calc-push-list-in-macro
+calc-pop-stack-in-macro)
("calc-rewr" calcFunc-match calcFunc-matches
calcFunc-matchnot calcFunc-rewrite calcFunc-vmatches
calc-find-parent-formula calc-find-sub-formula calc-prepare-selection
calc-preserve-point calc-replace-selections calc-replace-sub-formula
calc-roll-down-with-selections calc-roll-up-with-selections
-calc-sel-error)
+calc-sel-error calc-top-selected)
("calc-stat" calc-vector-op calcFunc-agmean calcFunc-rms
calcFunc-vcorr calcFunc-vcount calcFunc-vcov calcFunc-vflat
calc-vector-brackets calc-vector-commas calc-vector-parens
calc-working)
+ ("calc-nlfit" calc-fit-s-shaped-logistic-curve
+calc-fit-bell-shaped-logistic-curve)
+
("calc-prog" calc-call-last-kbd-macro calc-edit-user-syntax
calc-equal-to calc-get-user-defn calc-greater-equal calc-greater-than
calc-in-set calc-kbd-break calc-kbd-else calc-kbd-else-if
calc-unpack calc-unpack-bits calc-vector-find calc-vlength)
("calc-yank" calc-copy-as-kill calc-copy-region-as-kill
-calc-copy-to-buffer calc-edit calc-edit-cancel calc-edit-mode
-calc-kill calc-kill-region calc-yank))))
+calc-copy-to-buffer calc-edit calc-edit-cancel calc-edit-finish
+calc-edit-mode calc-kill calc-kill-region calc-yank))))
(defun calc-init-prefixes ()
(if calc-shift-prefix
;;; General.
-
+(defvar calc-embedded-quiet)
(defun calc-reset (arg)
(interactive "P")
(setq arg (if arg (prefix-numeric-value arg) nil))
;;; Expression parsing.
(defvar math-expr-data)
+(defvar math-exp-pos)
+(defvar math-exp-keep-spaces)
(defun math-read-expr (math-exp-str)
(let ((math-exp-pos 0)
(pos 0)
(width 0)
(math-read-big-err-msg nil)
- math-read-big-baseline math-read-big-h2
+ ; math-read-big-baseline math-read-big-h2 -- unused? --SY.
new-pos p)
(while (setq new-pos (string-match "\n" str pos))
(setq math-read-big-lines
(= (aref l2 i) (aref l1 i)))
(and (eq (aref l1 i) ?\[)
(eq (aref l2 i) ?\[)
- (let ((math-rb-h2 (length l1)))
- (setq j (math-read-big-balance
- (1+ i) v "[")))
+ (with-boundp 'math-rb-h2
+ (let ((math-rb-h2 (length l1)))
+ (setq j (math-read-big-balance
+ (1+ i) v "["))))
(setq i (1- j)))))
(setq i (1+ i)))
(or (= i len)
(require 'calc-ext)
(require 'calc-macs)
-
+(autoload 'dst-in-effect "cal-dst")
+(autoload 'calendar-current-time-zone "cal-dst")
+(autoload 'calendar-absolute-from-gregorian "calendar")
(defun calc-time ()
(interactive)
(defun math-setup-year-holidays (math-sh-year)
(let ((exprs (nth 2 math-holidays-cache)))
(while exprs
- (let* ((var-y math-sh-year)
- (var-m nil)
- (expr (math-evaluate-expr (car exprs))))
- (if (math-expr-contains expr '(var m var-m))
- (let ((var-m 0))
- (while (<= (setq var-m (1+ var-m)) 12)
- (math-setup-add-holidays (math-evaluate-expr expr))))
- (math-setup-add-holidays expr)))
+ (with-boundp '(var-m var-y)
+ (let* ((var-y math-sh-year)
+ (var-m nil)
+ (expr (math-evaluate-expr (car exprs))))
+ (if (math-expr-contains expr '(var m var-m))
+ (let ((var-m 0))
+ (while (<= (setq var-m (1+ var-m)) 12)
+ (math-setup-add-holidays (math-evaluate-expr expr))))
+ (math-setup-add-holidays expr))))
(setq exprs (cdr exprs)))))
(defun math-setup-add-holidays (days) ; uses "math-sh-year"
(calc-slow-wrapper
(let ((calcbuf (current-buffer))
(tempbuf (get-buffer-create "*Gnuplot Temp-2*"))
- (tempbuftop 1)
+ ; (tempbuftop 1) it gets let-bound further down --SY
(tempoutfile nil)
(calc-graph-curve-num 0)
(calc-graph-refine (and flag (> (prefix-numeric-value flag) 0)))
(set-window-buffer win buf)
(if (eq major-mode 'calc-mode)
(if (or need
- (not (window-full-height-p)))
+ (not (declare-fboundp (window-full-height-p))))
(display-buffer buf))
(switch-to-buffer buf)))))
(with-current-buffer buf
(require 'calc-ext)
(require 'calc-macs)
-
+(autoload 'Info-mode "info")
+(autoload 'Info-last "info" nil t)
(defun calc-help-prefix (arg)
"This key is the prefix for Calc help functions. See calc-help-for-help."
;;; Commentary:
;;; Code:
-
+(autoload 'math-compare "calc-ext")
(defmacro calc-wrapper (&rest body)
`(calc-do (function (lambda ()
(if (and
(math-realp a)
calc-use-bigfr)
- (math-use-emacs-fn (lambda (x) (root x math-nrf-n)))
+ (math-use-emacs-fn (lambda (x) (root x math-nrf-n)) a)
(let ((math-nrf-nf (math-float math-nrf-n))
(math-nrf-nfm1 (math-float (1- math-nrf-n))))
(math-nth-root-float-iter a (or guess
;;; Bug reporting
-
+(defvar reporter-prompt-for-summary-p)
;;;###autoload
(defun report-calc-bug ()
"Report a bug in Calc, the GNU Emacs calculator.
;; also get approximations for the bell curve parameters.
;;; Code:
-
+(globally-declare-boundp 'calc-curve-nvars)
(require 'calc-arith)
(require 'calcalg3)
(require 'calc-ext)
(require 'calc-macs)
-
+(autoload 'edmacro-format-keys "edmacro")
+(autoload 'edmacro-parse-keys "edmacro")
(defun calc-equal-to (arg)
(interactive "P")
(goto-char (point-max))
(let* ((fcmd (and cmd (symbolp cmd) (symbol-function cmd)))
(func nil)
- (pt (point))
+ ; (pt (point)) -- unused? --SY.
(fill-column 70)
(fill-prefix nil)
str q-ok)
;;; whole match the name v. Beware of circular structures!
;;;
+(defvar math-rewrite-whole nil)
+
(defun math-compile-patterns (pats)
(if (and (eq (car-safe pats) 'var)
(calc-var-value (nth 2 pats)))
(cdr pats)
(list pats)))))))))
-(defvar math-rewrite-whole nil)
(defvar math-make-import-list nil)
;; The variable math-import-list is local to part of math-compile-rewrites,
;;; Code:
;; This file is autoloaded from calc-ext.el.
-
+(globally-declare-boundp 'math-save-buf)
(require 'calc-ext)
(require 'calc-macs)
(uoldname nil)
(unitscancel nil)
(nouold nil)
- unew
+ ;; unew -- unused? --SY.
units
defunits)
(if (or (not (math-units-in-expr-p expr t))
;;; Code:
(require 'calc-macs)
-
+(eval-when-compile
+ (defalias 'read-event #'next-event))
(defgroup calc nil
"Advanced desk calculator and mathematical tool."
(let ((glob (current-global-map))
(loc (current-local-map)))
(or (input-pending-p) (message "%s" prompt))
- (let ((key (calc-read-key t))
- (input-method-function nil))
- (calc-unread-command (cdr key))
- (unwind-protect
- (progn
- (use-global-map map)
- (use-local-map nil)
- (read-key-sequence nil))
- (use-global-map glob)
- (use-local-map loc)))))
+ (with-boundp 'input-method-function
+ (let ((key (calc-read-key t))
+ (input-method-function nil))
+ (calc-unread-command (cdr key))
+ (unwind-protect
+ (progn
+ (use-global-map map)
+ (use-local-map nil)
+ (read-key-sequence nil))
+ (use-global-map glob)
+ (use-local-map loc))))))
(defvar calc-alg-map) ; Defined in calc-ext.el
(setq calc-standalone-flag t))
(setq p (cdr p))))
(require 'calc-menu)
- (easy-menu-add calc-menu)
+ (easy-menu-add (declare-boundp calc-menu))
(run-mode-hooks 'calc-mode-hook)
(calc-refresh t)
(calc-set-mode-line)
(math-integrate-by-parts (math-pow (nth 1 expr)
(math-sub (nth 2 expr) 1))
(nth 1 expr)))))
-
+(defvar math-doing-parts)
(defun math-integrate-by-parts (u vprime)
(let ((math-integ-level (if (or math-good-parts
(math-polynomial-p u math-integ-var))
(if (Math-negp count)
(setq count -1))
(if (integerp count)
- (let ((var-DUMMY nil)
- (vec math-tabulate-initial)
- (math-working-step-2 (1+ count))
- (math-working-step 0))
- (setq expr (math-evaluate-expr
- (math-expr-subst expr math-var '(var DUMMY var-DUMMY))))
- (while (>= count 0)
- (setq math-working-step (1+ math-working-step)
- var-DUMMY calc-low
- vec (cond ((eq math-tabulate-function 'calcFunc-sum)
- (math-add vec (math-evaluate-expr expr)))
- ((eq math-tabulate-function 'calcFunc-prod)
- (math-mul vec (math-evaluate-expr expr)))
- (t
- (cons (math-evaluate-expr expr) vec)))
- calc-low (math-add calc-low (or step 1))
- count (1- count)))
- (if math-tabulate-function
- vec
- (cons 'vec (nreverse vec))))
+ (with-boundp '(vec var-DUMMY)
+ (let ((var-DUMMY nil)
+ (vec math-tabulate-initial)
+ (math-working-step-2 (1+ count))
+ (math-working-step 0))
+ (setq expr (math-evaluate-expr
+ (math-expr-subst expr math-var '(var DUMMY var-DUMMY))))
+ (while (>= count 0)
+ (setq math-working-step (1+ math-working-step)
+ var-DUMMY calc-low
+ vec (cond ((eq math-tabulate-function 'calcFunc-sum)
+ (math-add vec (math-evaluate-expr expr)))
+ ((eq math-tabulate-function 'calcFunc-prod)
+ (math-mul vec (math-evaluate-expr expr)))
+ (t
+ (cons (math-evaluate-expr expr) vec)))
+ calc-low (math-add calc-low (or step 1))
+ count (1- count)))
+ (if math-tabulate-function
+ vec
+ (cons 'vec (nreverse vec)))))
(if (Math-integerp count)
(calc-record-why 'fixnump calc-high)
(if (Math-num-integerp calc-low)
(math-poly-integer-root (car roots))
(setq roots (cdr roots)))
(list math-int-factors (nreverse math-int-coefs) math-int-scale))
- (let ((vec nil) res)
+ (let ((vec nil)) ; res -- unused? --SY
(while roots
(let ((root (car roots))
(math-solve-full (and math-solve-full 'all)))
(defvar calc-curve-fit-history nil
"History for calc-curve-fit.")
+(defvar calc-graph-no-auto-view)
+
(defun calc-curve-fit (arg &optional calc-curve-model
calc-curve-coefnames calc-curve-varnames)
(interactive "P")
(setq res (math-mul res (math-sqr x))))
res))
+(defvar math-infinite-mode)
(defun math-ninteg-midpoint (expr lo hi mode) ; uses "math-ninteg-temp"
(if (eq mode 'inf)