From d37f2979c6e5307ff17d9986cc644b1178e0ee06 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 27 Nov 2004 04:07:22 +0000 Subject: (calc-eval-error): Declare and initialize the variable. (calc-eval-error): Don't check if the variable calc-eval-error is bound. (calc-buffer, calc-digit-value, math-expr-data): Declare them. (math-alg-inequalities): Move declaration to earlier in the file. --- lisp/calc/calc-aent.el | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'lisp/calc/calc-aent.el') diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index a615ec5062..da4fab5b83 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -240,9 +240,14 @@ res (cdr res))) buf))))))))) +(defvar calc-eval-error nil + "Determines how calc handles errors. +NIL means return a list containing the character position of error. +STRING means return error message as string rather than list. +T means abort and give an error message.") + (defun calc-eval-error (msg) - (if (and (boundp 'calc-eval-error) - calc-eval-error) + (if calc-eval-error (if (eq calc-eval-error 'string) (nth 1 msg) (error "%s" (nth 1 msg))) @@ -385,6 +390,8 @@ (and (> (length calc-alg-exp) 0) (setq calc-previous-alg-entry calc-alg-exp)) (exit-minibuffer))) +(defvar calc-buffer) + (defun calcAlg-enter () (interactive) (let* ((str (minibuffer-contents)) @@ -442,6 +449,10 @@ ((eq last-command-char ?@) "0@ ") (t (char-to-string last-command-char))))) +;; The variable calc-digit-value is initially declared in calc.el, +;; but can be set by calcDigit-algebraic and calcDigit-edit. +(defvar calc-digit-value) + (defun calcDigit-algebraic () (interactive) (if (calc-minibuffer-contains ".*[@oh] *[^'m ]+[^'m]*\\'") @@ -458,14 +469,15 @@ ;;; Algebraic expression parsing. [Public] -;;; The next few variables are local to math-read-exprs (and math-read-expr) -;;; but are set in functions they call. +;; The next few variables are local to math-read-exprs (and math-read-expr +;; in calc-ext.el), but are set in functions they call. (defvar math-exp-pos) (defvar math-exp-str) (defvar math-exp-old-pos) (defvar math-exp-token) (defvar math-exp-keep-spaces) +(defvar math-expr-data) (defun math-read-exprs (math-exp-str) (let ((math-exp-pos 0) @@ -727,6 +739,9 @@ math-expr-data (char-to-string ch) math-exp-pos (1+ math-exp-pos))))))) +(defconst math-alg-inequalities + '(calcFunc-lt calcFunc-gt calcFunc-leq calcFunc-geq + calcFunc-eq calcFunc-neq)) (defun math-read-expr-level (exp-prec &optional exp-term) (let* ((x (math-read-factor)) (first t) op op2) @@ -941,10 +956,6 @@ matches "Failed")) matches)) -(defconst math-alg-inequalities - '(calcFunc-lt calcFunc-gt calcFunc-leq calcFunc-geq - calcFunc-eq calcFunc-neq)) - (defun math-remove-dashes (x) (if (string-match "\\`\\(.*\\)-\\(.*\\)\\'" x) (math-remove-dashes -- cgit v1.2.3