Calc -- Build / compile warning and error clean up.
authorSteve Youngs <steve@sxemacs.org>
Sat, 14 Mar 2020 02:49:32 +0000 (12:49 +1000)
committerSteve Youngs <steve@sxemacs.org>
Sat, 14 Mar 2020 02:49:32 +0000 (12:49 +1000)
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>
18 files changed:
xemacs-packages/calc/Makefile
xemacs-packages/calc/calc-aent.el
xemacs-packages/calc/calc-embed.el
xemacs-packages/calc/calc-ext.el
xemacs-packages/calc/calc-forms.el
xemacs-packages/calc/calc-graph.el
xemacs-packages/calc/calc-help.el
xemacs-packages/calc/calc-macs.el
xemacs-packages/calc/calc-math.el
xemacs-packages/calc/calc-misc.el
xemacs-packages/calc/calc-nlfit.el
xemacs-packages/calc/calc-prog.el
xemacs-packages/calc/calc-rewr.el
xemacs-packages/calc/calc-trail.el
xemacs-packages/calc/calc-units.el
xemacs-packages/calc/calc.el
xemacs-packages/calc/calcalg2.el
xemacs-packages/calc/calcalg3.el

index 26c604e..a826753 100644 (file)
 
 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 \
@@ -31,17 +31,22 @@ 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
index 320b969..273bb7b 100644 (file)
@@ -310,8 +310,8 @@ The value t means abort and give an error message.")
 
 ;;;###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
index 2f14ca4..82a2849 100644 (file)
@@ -27,7 +27,7 @@
 
 (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))
index 79fac71..4a311e6 100644 (file)
@@ -704,6 +704,8 @@ calcFunc-root calcFunc-wmaximize calcFunc-wminimize calcFunc-wroot
 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
@@ -728,14 +730,15 @@ math-mul-or-div math-mul-symb-fancy math-mul-zero math-neg-fancy
 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
@@ -749,7 +752,8 @@ math-random-base)
 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
@@ -758,8 +762,10 @@ math-polar math-want-polar)
 
  ("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
@@ -795,16 +801,17 @@ calcFunc-ltpn calcFunc-ltpp calcFunc-ltpt calcFunc-utpb calcFunc-utpc
 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
@@ -837,10 +844,13 @@ math-from-radians math-from-radians-2 math-hypot math-infinite-dir
 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
@@ -865,7 +875,8 @@ calcFunc-negative calcFunc-neq calcFunc-nonvar calcFunc-real
 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
@@ -883,7 +894,7 @@ calc-delete-selection calc-encase-atoms calc-find-assoc-parent-formula
 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
@@ -1066,6 +1077,9 @@ calc-truncate-up calc-units-simplify-mode calc-vector-braces
 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
@@ -1152,8 +1166,8 @@ calc-set-xor calc-sort calc-subvector calc-tail calc-transpose
 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
@@ -1285,7 +1299,7 @@ calc-kill calc-kill-region calc-yank))))
 
 
 ;;; General.
-
+(defvar calc-embedded-quiet)
 (defun calc-reset (arg)
   (interactive "P")
   (setq arg (if arg (prefix-numeric-value arg) nil))
@@ -3037,6 +3051,8 @@ If X is not an error form, return 1."
 ;;; 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)
@@ -3100,7 +3116,7 @@ If X is not an error form, return 1."
          (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
@@ -3139,9 +3155,10 @@ If X is not an error form, return 1."
                                            (= (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)
index 1219c75..408e16a 100644 (file)
@@ -27,7 +27,9 @@
 
 (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)
@@ -2018,14 +2020,15 @@ and ends on the last Sunday of October at 2 a.m."
 (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"
index fc5541b..e33d914 100644 (file)
   (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)))
@@ -1407,7 +1407,7 @@ This \"dumb\" driver will be present in Gnuplot 3.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
index 11646e3..a068e34 100644 (file)
@@ -27,7 +27,8 @@
 
 (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."
index e66800d..499284f 100644 (file)
@@ -22,7 +22,7 @@
 ;;; Commentary:
 
 ;;; Code:
-
+(autoload 'math-compare "calc-ext")
 
 (defmacro calc-wrapper (&rest body)
   `(calc-do (function (lambda ()
index 3a728ed..e63fd2c 100644 (file)
@@ -592,7 +592,7 @@ return NIL."
   (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
index c032a6d..d89ad58 100644 (file)
@@ -893,7 +893,7 @@ loaded and the keystroke automatically re-typed."
 
 
 ;;; Bug reporting
-
+(defvar reporter-prompt-for-summary-p)
 ;;;###autoload
 (defun report-calc-bug ()
   "Report a bug in Calc, the GNU Emacs calculator.
index 52f2e94..993f62e 100644 (file)
@@ -55,7 +55,7 @@
 ;; also get approximations for the bell curve parameters.
 
 ;;; Code:
-
+(globally-declare-boundp 'calc-curve-nvars)
 (require 'calc-arith)
 (require 'calcalg3)
 
index 105320e..808437f 100644 (file)
@@ -27,7 +27,8 @@
 
 (require 'calc-ext)
 (require 'calc-macs)
-
+(autoload 'edmacro-format-keys "edmacro")
+(autoload 'edmacro-parse-keys "edmacro")
 
 (defun calc-equal-to (arg)
   (interactive "P")
@@ -1001,7 +1002,7 @@ Redefine the corresponding command."
      (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)
index bace504..7bc23e8 100644 (file)
 ;;;    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,
index 2734803..5df6c83 100644 (file)
@@ -24,7 +24,7 @@
 ;;; Code:
 
 ;; This file is autoloaded from calc-ext.el.
-
+(globally-declare-boundp 'math-save-buf)
 (require 'calc-ext)
 (require 'calc-macs)
 
index 71f854c..8651353 100644 (file)
@@ -445,7 +445,7 @@ If COMP or STD is non-nil, put that in the units table instead."
         (uoldname nil)
          (unitscancel nil)
          (nouold nil)
-        unew
+        ;; unew -- unused? --SY.
          units
          defunits)
      (if (or (not (math-units-in-expr-p expr t))
index eb42c52..1d34743 100644 (file)
 ;;; Code:
 
 (require 'calc-macs)
-
+(eval-when-compile
+  (defalias 'read-event #'next-event))
 
 (defgroup calc nil
   "Advanced desk calculator and mathematical tool."
@@ -1144,16 +1145,17 @@ Used by `calc-user-invocation'.")
   (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
 
@@ -1278,7 +1280,7 @@ Notations:  3.14e6     3.14 * 10^6
           (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)
index 831a8eb..c324080 100644 (file)
           (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)))
index b54b7ae..cacc3cf 100644 (file)
 (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)