diff options
| author | Jay Belanger | 2004-11-29 05:56:06 +0000 |
|---|---|---|
| committer | Jay Belanger | 2004-11-29 05:56:06 +0000 |
| commit | 5eb3eedabbbf01b28527daeca3e313d56ff773b6 (patch) | |
| tree | e14392bed6e23b5682c0950ea56e178cedc1435e | |
| parent | 6697b53cd34f8ba4b5586dc544aaa03fd301bbe3 (diff) | |
| download | emacs-5eb3eedabbbf01b28527daeca3e313d56ff773b6.tar.gz emacs-5eb3eedabbbf01b28527daeca3e313d56ff773b6.zip | |
Remove unnecessary eval-when-compile.
(calc-do-quick-calc, calc-do-calc-eval, calc-alg-entry)
(math-read-expr-level, calc-check-user-syntax, math-read-factor):
Replace calls to calc-extensions by appropriate require,
replace calc-extensions-loaded by appropriate featurep.
| -rw-r--r-- | lisp/calc/calc-aent.el | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index da4fab5b830..49f11fe0ba0 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el | |||
| @@ -27,10 +27,9 @@ | |||
| 27 | ;;; Code: | 27 | ;;; Code: |
| 28 | 28 | ||
| 29 | ;; This file is autoloaded from calc.el. | 29 | ;; This file is autoloaded from calc.el. |
| 30 | (require 'calc) | ||
| 31 | 30 | ||
| 31 | (require 'calc) | ||
| 32 | (require 'calc-macs) | 32 | (require 'calc-macs) |
| 33 | (eval-when-compile '(require calc-macs)) | ||
| 34 | 33 | ||
| 35 | (defun calc-Need-calc-aent () nil) | 34 | (defun calc-Need-calc-aent () nil) |
| 36 | 35 | ||
| @@ -51,20 +50,20 @@ | |||
| 51 | (entry (calc-do-alg-entry "" "Quick calc: " t)) | 50 | (entry (calc-do-alg-entry "" "Quick calc: " t)) |
| 52 | (alg-exp (mapcar (function | 51 | (alg-exp (mapcar (function |
| 53 | (lambda (x) | 52 | (lambda (x) |
| 54 | (if (and (not calc-extensions-loaded) | 53 | (if (and (not (featurep 'calc-ext)) |
| 55 | calc-previous-alg-entry | 54 | calc-previous-alg-entry |
| 56 | (string-match | 55 | (string-match |
| 57 | "\\`[-0-9._+*/^() ]+\\'" | 56 | "\\`[-0-9._+*/^() ]+\\'" |
| 58 | calc-previous-alg-entry)) | 57 | calc-previous-alg-entry)) |
| 59 | (calc-normalize x) | 58 | (calc-normalize x) |
| 60 | (calc-extensions) | 59 | (require 'calc-ext) |
| 61 | (math-evaluate-expr x)))) | 60 | (math-evaluate-expr x)))) |
| 62 | entry))) | 61 | entry))) |
| 63 | (when (and (= (length alg-exp) 1) | 62 | (when (and (= (length alg-exp) 1) |
| 64 | (eq (car-safe (car alg-exp)) 'calcFunc-assign) | 63 | (eq (car-safe (car alg-exp)) 'calcFunc-assign) |
| 65 | (= (length (car alg-exp)) 3) | 64 | (= (length (car alg-exp)) 3) |
| 66 | (eq (car-safe (nth 1 (car alg-exp))) 'var)) | 65 | (eq (car-safe (nth 1 (car alg-exp))) 'var)) |
| 67 | (calc-extensions) | 66 | (require 'calc-ext) |
| 68 | (set (nth 2 (nth 1 (car alg-exp))) (nth 2 (car alg-exp))) | 67 | (set (nth 2 (nth 1 (car alg-exp))) (nth 2 (car alg-exp))) |
| 69 | (calc-refresh-evaltos (nth 2 (nth 1 (car alg-exp)))) | 68 | (calc-refresh-evaltos (nth 2 (nth 1 (car alg-exp)))) |
| 70 | (setq alg-exp (list (nth 2 (car alg-exp))))) | 69 | (setq alg-exp (list (nth 2 (car alg-exp))))) |
| @@ -91,7 +90,7 @@ | |||
| 91 | "") | 90 | "") |
| 92 | ")"))) | 91 | ")"))) |
| 93 | (if (and (< (length buf) (frame-width)) (= (length entry) 1) | 92 | (if (and (< (length buf) (frame-width)) (= (length entry) 1) |
| 94 | calc-extensions-loaded) | 93 | (featurep 'calc-ext)) |
| 95 | (let ((long (concat (math-format-value (car entry) 1000) | 94 | (let ((long (concat (math-format-value (car entry) 1000) |
| 96 | " => " buf))) | 95 | " => " buf))) |
| 97 | (if (<= (length long) (- (frame-width) 8)) | 96 | (if (<= (length long) (- (frame-width) 8)) |
| @@ -147,7 +146,7 @@ | |||
| 147 | ((eq separator 'eval) | 146 | ((eq separator 'eval) |
| 148 | (eval str)) | 147 | (eval str)) |
| 149 | ((eq separator 'macro) | 148 | ((eq separator 'macro) |
| 150 | (calc-extensions) | 149 | (require 'calc-ext) |
| 151 | (let* ((calc-buffer (current-buffer)) | 150 | (let* ((calc-buffer (current-buffer)) |
| 152 | (calc-window (get-buffer-window calc-buffer)) | 151 | (calc-window (get-buffer-window calc-buffer)) |
| 153 | (save-window (selected-window))) | 152 | (save-window (selected-window))) |
| @@ -208,7 +207,7 @@ | |||
| 208 | (and (memq 'clear-message calc-command-flags) | 207 | (and (memq 'clear-message calc-command-flags) |
| 209 | (message "")) | 208 | (message "")) |
| 210 | (cond ((eq separator 'pred) | 209 | (cond ((eq separator 'pred) |
| 211 | (calc-extensions) | 210 | (require 'calc-ext) |
| 212 | (if (= (length res) 1) | 211 | (if (= (length res) 1) |
| 213 | (math-is-true (car res)) | 212 | (math-is-true (car res)) |
| 214 | (calc-eval-error '(0 "Single value expected")))) | 213 | (calc-eval-error '(0 "Single value expected")))) |
| @@ -276,19 +275,19 @@ T means abort and give an error message.") | |||
| 276 | (alg-exp (calc-do-alg-entry initial prompt t))) | 275 | (alg-exp (calc-do-alg-entry initial prompt t))) |
| 277 | (if (stringp alg-exp) | 276 | (if (stringp alg-exp) |
| 278 | (progn | 277 | (progn |
| 279 | (calc-extensions) | 278 | (require 'calc-ext) |
| 280 | (calc-alg-edit alg-exp)) | 279 | (calc-alg-edit alg-exp)) |
| 281 | (let* ((calc-simplify-mode (if (eq last-command-char ?\C-j) | 280 | (let* ((calc-simplify-mode (if (eq last-command-char ?\C-j) |
| 282 | 'none | 281 | 'none |
| 283 | calc-simplify-mode)) | 282 | calc-simplify-mode)) |
| 284 | (nvals (mapcar 'calc-normalize alg-exp))) | 283 | (nvals (mapcar 'calc-normalize alg-exp))) |
| 285 | (while alg-exp | 284 | (while alg-exp |
| 286 | (calc-record (if calc-extensions-loaded (car alg-exp) (car nvals)) | 285 | (calc-record (if (featurep 'calc-ext) (car alg-exp) (car nvals)) |
| 287 | "alg'") | 286 | "alg'") |
| 288 | (calc-pop-push-record-list calc-dollar-used | 287 | (calc-pop-push-record-list calc-dollar-used |
| 289 | (and (not (equal (car alg-exp) | 288 | (and (not (equal (car alg-exp) |
| 290 | (car nvals))) | 289 | (car nvals))) |
| 291 | calc-extensions-loaded | 290 | (featurep 'calc-ext) |
| 292 | "") | 291 | "") |
| 293 | (list (car nvals))) | 292 | (list (car nvals))) |
| 294 | (setq alg-exp (cdr alg-exp) | 293 | (setq alg-exp (cdr alg-exp) |
| @@ -786,7 +785,7 @@ T means abort and give an error message.") | |||
| 786 | (if (not (equal (car op) "2x")) | 785 | (if (not (equal (car op) "2x")) |
| 787 | (math-read-token)) | 786 | (math-read-token)) |
| 788 | (and (memq (nth 1 op) '(sdev mod)) | 787 | (and (memq (nth 1 op) '(sdev mod)) |
| 789 | (calc-extensions)) | 788 | (require 'calc-ext)) |
| 790 | (setq x (cond ((consp (nth 1 op)) | 789 | (setq x (cond ((consp (nth 1 op)) |
| 791 | (funcall (car (nth 1 op)) x op)) | 790 | (funcall (car (nth 1 op)) x op)) |
| 792 | ((eq (nth 3 op) -1) | 791 | ((eq (nth 3 op) -1) |
| @@ -802,7 +801,7 @@ T means abort and give an error message.") | |||
| 802 | ((and (not first) | 801 | ((and (not first) |
| 803 | (memq (nth 1 op) math-alg-inequalities) | 802 | (memq (nth 1 op) math-alg-inequalities) |
| 804 | (memq (car-safe x) math-alg-inequalities)) | 803 | (memq (car-safe x) math-alg-inequalities)) |
| 805 | (calc-extensions) | 804 | (require 'calc-ext) |
| 806 | (math-composite-inequalities x op)) | 805 | (math-composite-inequalities x op)) |
| 807 | (t (list (nth 1 op) | 806 | (t (list (nth 1 op) |
| 808 | x | 807 | x |
| @@ -830,7 +829,7 @@ T means abort and give an error message.") | |||
| 830 | (or (not (listp | 829 | (or (not (listp |
| 831 | (setq matches (calc-match-user-syntax rule)))) | 830 | (setq matches (calc-match-user-syntax rule)))) |
| 832 | (let ((args (progn | 831 | (let ((args (progn |
| 833 | (calc-extensions) | 832 | (require 'calc-ext) |
| 834 | calc-arg-values)) | 833 | calc-arg-values)) |
| 835 | (conds nil) | 834 | (conds nil) |
| 836 | temp) | 835 | temp) |
| @@ -845,7 +844,7 @@ T means abort and give an error message.") | |||
| 845 | conds) | 844 | conds) |
| 846 | match (nth 1 match))) | 845 | match (nth 1 match))) |
| 847 | (while (and conds match) | 846 | (while (and conds match) |
| 848 | (calc-extensions) | 847 | (require 'calc-ext) |
| 849 | (cond ((eq (car-safe (car conds)) | 848 | (cond ((eq (car-safe (car conds)) |
| 850 | 'calcFunc-let) | 849 | 'calcFunc-let) |
| 851 | (setq temp (car conds)) | 850 | (setq temp (car conds)) |
| @@ -1037,7 +1036,7 @@ T means abort and give an error message.") | |||
| 1037 | (throw 'syntax "Expected `)'")) | 1036 | (throw 'syntax "Expected `)'")) |
| 1038 | (math-read-token) | 1037 | (math-read-token) |
| 1039 | (if (and (eq calc-language 'fortran) args | 1038 | (if (and (eq calc-language 'fortran) args |
| 1040 | (calc-extensions) | 1039 | (require 'calc-ext) |
| 1041 | (let ((calc-matrix-mode 'scalar)) | 1040 | (let ((calc-matrix-mode 'scalar)) |
| 1042 | (math-known-matrixp | 1041 | (math-known-matrixp |
| 1043 | (list 'var sym | 1042 | (list 'var sym |
| @@ -1096,7 +1095,7 @@ T means abort and give an error message.") | |||
| 1096 | ((eq math-exp-token 'hash) | 1095 | ((eq math-exp-token 'hash) |
| 1097 | (or calc-hashes-used | 1096 | (or calc-hashes-used |
| 1098 | (throw 'syntax "#'s not allowed in this context")) | 1097 | (throw 'syntax "#'s not allowed in this context")) |
| 1099 | (calc-extensions) | 1098 | (require 'calc-ext) |
| 1100 | (if (<= math-expr-data (length calc-arg-values)) | 1099 | (if (<= math-expr-data (length calc-arg-values)) |
| 1101 | (let ((num math-expr-data)) | 1100 | (let ((num math-expr-data)) |
| 1102 | (math-read-token) | 1101 | (math-read-token) |
| @@ -1127,7 +1126,7 @@ T means abort and give an error message.") | |||
| 1127 | (setq exp (if (and exp2 (Math-realp exp) | 1126 | (setq exp (if (and exp2 (Math-realp exp) |
| 1128 | (Math-anglep exp2)) | 1127 | (Math-anglep exp2)) |
| 1129 | (math-normalize (list 'polar exp exp2)) | 1128 | (math-normalize (list 'polar exp exp2)) |
| 1130 | (calc-extensions) | 1129 | (require 'calc-ext) |
| 1131 | (list '* exp | 1130 | (list '* exp |
| 1132 | (list 'calcFunc-exp | 1131 | (list 'calcFunc-exp |
| 1133 | (list '* | 1132 | (list '* |
| @@ -1154,16 +1153,16 @@ T means abort and give an error message.") | |||
| 1154 | (math-read-token) | 1153 | (math-read-token) |
| 1155 | exp)) | 1154 | exp)) |
| 1156 | ((eq math-exp-token 'string) | 1155 | ((eq math-exp-token 'string) |
| 1157 | (calc-extensions) | 1156 | (require 'calc-ext) |
| 1158 | (math-read-string)) | 1157 | (math-read-string)) |
| 1159 | ((equal math-expr-data "[") | 1158 | ((equal math-expr-data "[") |
| 1160 | (calc-extensions) | 1159 | (require 'calc-ext) |
| 1161 | (math-read-brackets t "]")) | 1160 | (math-read-brackets t "]")) |
| 1162 | ((equal math-expr-data "{") | 1161 | ((equal math-expr-data "{") |
| 1163 | (calc-extensions) | 1162 | (require 'calc-ext) |
| 1164 | (math-read-brackets nil "}")) | 1163 | (math-read-brackets nil "}")) |
| 1165 | ((equal math-expr-data "<") | 1164 | ((equal math-expr-data "<") |
| 1166 | (calc-extensions) | 1165 | (require 'calc-ext) |
| 1167 | (math-read-angle-brackets)) | 1166 | (math-read-angle-brackets)) |
| 1168 | (t (throw 'syntax "Expected a number"))))) | 1167 | (t (throw 'syntax "Expected a number"))))) |
| 1169 | 1168 | ||