diff options
| author | Jay Belanger | 2011-01-20 21:48:26 -0600 |
|---|---|---|
| committer | Jay Belanger | 2011-01-20 21:48:26 -0600 |
| commit | 26d82c3ad3000b1f8befad731c54fa2378937f96 (patch) | |
| tree | ba07cac7436219a280154dbeba339ad6e53a7843 | |
| parent | a10c414934da18eccff3a5a688c9f42ba483002a (diff) | |
| download | emacs-26d82c3ad3000b1f8befad731c54fa2378937f96.tar.gz emacs-26d82c3ad3000b1f8befad731c54fa2378937f96.zip | |
calc/calc-prog.el
calc/calc-graph.el
calc/calc-map.el: Change `arglist' to `math-arglist' throughout.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/calc/calc-graph.el | 22 | ||||
| -rw-r--r-- | lisp/calc/calc-map.el | 26 | ||||
| -rw-r--r-- | lisp/calc/calc-prog.el | 30 |
4 files changed, 45 insertions, 39 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6da4500d266..e973fcd6d56 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-01-21 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc/calc-prog.el | ||
| 4 | calc/calc-graph.el | ||
| 5 | calc/calc-map.el: Change `arglist' to `math-arglist' throughout. | ||
| 6 | |||
| 1 | 2011-01-21 Štěpán Němec <stepnem@gmail.com> (tiny change) | 7 | 2011-01-21 Štěpán Němec <stepnem@gmail.com> (tiny change) |
| 2 | 8 | ||
| 3 | * calc/calc-ext.el (calc-init-extensions): Map all `undo' | 9 | * calc/calc-ext.el (calc-init-extensions): Map all `undo' |
diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index 37db8ebbd7d..86f58a8bbc8 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el | |||
| @@ -575,16 +575,16 @@ | |||
| 575 | (setq calc-graph-xstep 1) | 575 | (setq calc-graph-xstep 1) |
| 576 | (error "%s is not a suitable basis for %s" calc-graph-xname calc-graph-yname))))) | 576 | (error "%s is not a suitable basis for %s" calc-graph-xname calc-graph-yname))))) |
| 577 | (or (math-realp calc-graph-yvalue) | 577 | (or (math-realp calc-graph-yvalue) |
| 578 | (let ((arglist nil)) | 578 | (let ((math-arglist nil)) |
| 579 | (setq calc-graph-yvalue (math-evaluate-expr calc-graph-yvalue)) | 579 | (setq calc-graph-yvalue (math-evaluate-expr calc-graph-yvalue)) |
| 580 | (calc-default-formula-arglist calc-graph-yvalue) | 580 | (calc-default-formula-arglist calc-graph-yvalue) |
| 581 | (or arglist | 581 | (or math-arglist |
| 582 | (error "%s does not contain any unassigned variables" calc-graph-yname)) | 582 | (error "%s does not contain any unassigned variables" calc-graph-yname)) |
| 583 | (and (cdr arglist) | 583 | (and (cdr math-arglist) |
| 584 | (error "%s contains more than one variable: %s" | 584 | (error "%s contains more than one variable: %s" |
| 585 | calc-graph-yname arglist)) | 585 | calc-graph-yname math-arglist)) |
| 586 | (setq calc-graph-yvalue (math-expr-subst calc-graph-yvalue | 586 | (setq calc-graph-yvalue (math-expr-subst calc-graph-yvalue |
| 587 | (math-build-var-name (car arglist)) | 587 | (math-build-var-name (car math-arglist)) |
| 588 | '(var DUMMY var-DUMMY))))) | 588 | '(var DUMMY var-DUMMY))))) |
| 589 | (setq calc-graph-ycache (assoc calc-graph-yvalue calc-graph-data-cache)) | 589 | (setq calc-graph-ycache (assoc calc-graph-yvalue calc-graph-data-cache)) |
| 590 | (delq calc-graph-ycache calc-graph-data-cache) | 590 | (delq calc-graph-ycache calc-graph-data-cache) |
| @@ -736,17 +736,17 @@ | |||
| 736 | calc-graph-zp calc-graph-yvalue | 736 | calc-graph-zp calc-graph-yvalue |
| 737 | calc-graph-xvec t)) | 737 | calc-graph-xvec t)) |
| 738 | (or (math-realp calc-graph-yvalue) | 738 | (or (math-realp calc-graph-yvalue) |
| 739 | (let ((arglist nil)) | 739 | (let ((math-arglist nil)) |
| 740 | (setq calc-graph-yvalue (math-evaluate-expr calc-graph-yvalue)) | 740 | (setq calc-graph-yvalue (math-evaluate-expr calc-graph-yvalue)) |
| 741 | (calc-default-formula-arglist calc-graph-yvalue) | 741 | (calc-default-formula-arglist calc-graph-yvalue) |
| 742 | (setq arglist (sort arglist 'string-lessp)) | 742 | (setq math-arglist (sort math-arglist 'string-lessp)) |
| 743 | (or (cdr arglist) | 743 | (or (cdr math-arglist) |
| 744 | (error "%s does not contain enough unassigned variables" calc-graph-yname)) | 744 | (error "%s does not contain enough unassigned variables" calc-graph-yname)) |
| 745 | (and (cdr (cdr arglist)) | 745 | (and (cdr (cdr math-arglist)) |
| 746 | (error "%s contains too many variables: %s" calc-graph-yname arglist)) | 746 | (error "%s contains too many variables: %s" calc-graph-yname math-arglist)) |
| 747 | (setq calc-graph-yvalue (math-multi-subst calc-graph-yvalue | 747 | (setq calc-graph-yvalue (math-multi-subst calc-graph-yvalue |
| 748 | (mapcar 'math-build-var-name | 748 | (mapcar 'math-build-var-name |
| 749 | arglist) | 749 | math-arglist) |
| 750 | '((var DUMMY var-DUMMY) | 750 | '((var DUMMY var-DUMMY) |
| 751 | (var DUMMY2 var-DUMMY2)))))) | 751 | (var DUMMY2 var-DUMMY2)))))) |
| 752 | (if (setq calc-graph-xvec (eq (car-safe calc-graph-xvalue) 'vec)) | 752 | (if (setq calc-graph-xvec (eq (car-safe calc-graph-xvalue) 'vec)) |
diff --git a/lisp/calc/calc-map.el b/lisp/calc/calc-map.el index a37fe5375f5..934968c1ef6 100644 --- a/lisp/calc/calc-map.el +++ b/lisp/calc/calc-map.el | |||
| @@ -572,7 +572,7 @@ | |||
| 572 | (and nargs forcenargs (/= nargs forcenargs) (>= nargs 0) | 572 | (and nargs forcenargs (/= nargs forcenargs) (>= nargs 0) |
| 573 | (error "Must be a %d-argument operator" nargs))) | 573 | (error "Must be a %d-argument operator" nargs))) |
| 574 | ((memq key '(?\$ ?\')) | 574 | ((memq key '(?\$ ?\')) |
| 575 | (let* ((arglist nil) | 575 | (let* ((math-arglist nil) |
| 576 | (has-args nil) | 576 | (has-args nil) |
| 577 | (record-entry nil) | 577 | (record-entry nil) |
| 578 | (expr (if (eq key ?\$) | 578 | (expr (if (eq key ?\$) |
| @@ -592,13 +592,13 @@ | |||
| 592 | (if (> calc-dollar-used 0) | 592 | (if (> calc-dollar-used 0) |
| 593 | (progn | 593 | (progn |
| 594 | (setq has-args calc-dollar-used | 594 | (setq has-args calc-dollar-used |
| 595 | arglist (calc-invent-args has-args)) | 595 | math-arglist (calc-invent-args has-args)) |
| 596 | (math-multi-subst (car func) | 596 | (math-multi-subst (car func) |
| 597 | (reverse arglist) | 597 | (reverse math-arglist) |
| 598 | arglist)) | 598 | math-arglist)) |
| 599 | (if (> calc-hashes-used 0) | 599 | (if (> calc-hashes-used 0) |
| 600 | (setq has-args calc-hashes-used | 600 | (setq has-args calc-hashes-used |
| 601 | arglist (calc-invent-args has-args))) | 601 | math-arglist (calc-invent-args has-args))) |
| 602 | (car func)))))) | 602 | (car func)))))) |
| 603 | (if (eq (car-safe expr) 'calcFunc-lambda) | 603 | (if (eq (car-safe expr) 'calcFunc-lambda) |
| 604 | (setq oper (list "$" (- (length expr) 2) expr) | 604 | (setq oper (list "$" (- (length expr) 2) expr) |
| @@ -607,16 +607,16 @@ | |||
| 607 | (progn | 607 | (progn |
| 608 | (calc-default-formula-arglist expr) | 608 | (calc-default-formula-arglist expr) |
| 609 | (setq record-entry t | 609 | (setq record-entry t |
| 610 | arglist (sort arglist 'string-lessp)) | 610 | math-arglist (sort math-arglist 'string-lessp)) |
| 611 | (if calc-verify-arglist | 611 | (if calc-verify-arglist |
| 612 | (setq arglist (read-from-minibuffer | 612 | (setq math-arglist (read-from-minibuffer |
| 613 | "Function argument list: " | 613 | "Function argument list: " |
| 614 | (if arglist | 614 | (if math-arglist |
| 615 | (prin1-to-string arglist) | 615 | (prin1-to-string math-arglist) |
| 616 | "()") | 616 | "()") |
| 617 | minibuffer-local-map | 617 | minibuffer-local-map |
| 618 | t))) | 618 | t))) |
| 619 | (setq arglist (mapcar (function | 619 | (setq math-arglist (mapcar (function |
| 620 | (lambda (x) | 620 | (lambda (x) |
| 621 | (list 'var | 621 | (list 'var |
| 622 | x | 622 | x |
| @@ -624,10 +624,10 @@ | |||
| 624 | (concat | 624 | (concat |
| 625 | "var-" | 625 | "var-" |
| 626 | (symbol-name x)))))) | 626 | (symbol-name x)))))) |
| 627 | arglist)))) | 627 | math-arglist)))) |
| 628 | (setq oper (list "$" | 628 | (setq oper (list "$" |
| 629 | (length arglist) | 629 | (length math-arglist) |
| 630 | (append '(calcFunc-lambda) arglist | 630 | (append '(calcFunc-lambda) math-arglist |
| 631 | (list expr))) | 631 | (list expr))) |
| 632 | done t)) | 632 | done t)) |
| 633 | (if record-entry | 633 | (if record-entry |
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index efdb8fc88ea..a7299122598 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el | |||
| @@ -171,17 +171,17 @@ | |||
| 171 | (interactive) | 171 | (interactive) |
| 172 | (calc-wrapper | 172 | (calc-wrapper |
| 173 | (let* ((form (calc-top 1)) | 173 | (let* ((form (calc-top 1)) |
| 174 | (arglist nil) | 174 | (math-arglist nil) |
| 175 | (is-lambda (and (eq (car-safe form) 'calcFunc-lambda) | 175 | (is-lambda (and (eq (car-safe form) 'calcFunc-lambda) |
| 176 | (>= (length form) 2))) | 176 | (>= (length form) 2))) |
| 177 | odef key keyname cmd cmd-base cmd-base-default | 177 | odef key keyname cmd cmd-base cmd-base-default |
| 178 | func calc-user-formula-alist is-symb) | 178 | func calc-user-formula-alist is-symb) |
| 179 | (if is-lambda | 179 | (if is-lambda |
| 180 | (setq arglist (mapcar (function (lambda (x) (nth 1 x))) | 180 | (setq math-arglist (mapcar (function (lambda (x) (nth 1 x))) |
| 181 | (nreverse (cdr (reverse (cdr form))))) | 181 | (nreverse (cdr (reverse (cdr form))))) |
| 182 | form (nth (1- (length form)) form)) | 182 | form (nth (1- (length form)) form)) |
| 183 | (calc-default-formula-arglist form) | 183 | (calc-default-formula-arglist form) |
| 184 | (setq arglist (sort arglist 'string-lessp))) | 184 | (setq math-arglist (sort math-arglist 'string-lessp))) |
| 185 | (message "Define user key: z-") | 185 | (message "Define user key: z-") |
| 186 | (setq key (read-char)) | 186 | (setq key (read-char)) |
| 187 | (if (= (calc-user-function-classify key) 0) | 187 | (if (= (calc-user-function-classify key) 0) |
| @@ -267,17 +267,17 @@ | |||
| 267 | (format "%05d" (% (random) 10000))))))) | 267 | (format "%05d" (% (random) 10000))))))) |
| 268 | 268 | ||
| 269 | (if is-lambda | 269 | (if is-lambda |
| 270 | (setq calc-user-formula-alist arglist) | 270 | (setq calc-user-formula-alist math-arglist) |
| 271 | (while | 271 | (while |
| 272 | (progn | 272 | (progn |
| 273 | (setq calc-user-formula-alist | 273 | (setq calc-user-formula-alist |
| 274 | (read-from-minibuffer "Function argument list: " | 274 | (read-from-minibuffer "Function argument list: " |
| 275 | (if arglist | 275 | (if math-arglist |
| 276 | (prin1-to-string arglist) | 276 | (prin1-to-string math-arglist) |
| 277 | "()") | 277 | "()") |
| 278 | minibuffer-local-map | 278 | minibuffer-local-map |
| 279 | t)) | 279 | t)) |
| 280 | (and (not (calc-subsetp calc-user-formula-alist arglist)) | 280 | (and (not (calc-subsetp calc-user-formula-alist math-arglist)) |
| 281 | (not (y-or-n-p | 281 | (not (y-or-n-p |
| 282 | "Okay for arguments that don't appear in formula to be ignored? ")))))) | 282 | "Okay for arguments that don't appear in formula to be ignored? ")))))) |
| 283 | (setq is-symb (and calc-user-formula-alist | 283 | (setq is-symb (and calc-user-formula-alist |
| @@ -328,14 +328,14 @@ | |||
| 328 | (setcdr kmap (cons (cons key cmd) (cdr kmap))))))) | 328 | (setcdr kmap (cons (cons key cmd) (cdr kmap))))))) |
| 329 | (message ""))) | 329 | (message ""))) |
| 330 | 330 | ||
| 331 | (defvar arglist) ; dynamically bound in all callers | 331 | (defvar math-arglist) ; dynamically bound in all callers |
| 332 | (defun calc-default-formula-arglist (form) | 332 | (defun calc-default-formula-arglist (form) |
| 333 | (if (consp form) | 333 | (if (consp form) |
| 334 | (if (eq (car form) 'var) | 334 | (if (eq (car form) 'var) |
| 335 | (if (or (memq (nth 1 form) arglist) | 335 | (if (or (memq (nth 1 form) math-arglist) |
| 336 | (math-const-var form)) | 336 | (math-const-var form)) |
| 337 | () | 337 | () |
| 338 | (setq arglist (cons (nth 1 form) arglist))) | 338 | (setq math-arglist (cons (nth 1 form) math-arglist))) |
| 339 | (calc-default-formula-arglist-step (cdr form))))) | 339 | (calc-default-formula-arglist-step (cdr form))))) |
| 340 | 340 | ||
| 341 | (defun calc-default-formula-arglist-step (l) | 341 | (defun calc-default-formula-arglist-step (l) |
| @@ -394,23 +394,23 @@ | |||
| 394 | (intern (concat "calcFunc-" x)))))))) | 394 | (intern (concat "calcFunc-" x)))))))) |
| 395 | (comps (get func 'math-compose-forms)) | 395 | (comps (get func 'math-compose-forms)) |
| 396 | entry entry2 | 396 | entry entry2 |
| 397 | (arglist nil) | 397 | (math-arglist nil) |
| 398 | (calc-user-formula-alist nil)) | 398 | (calc-user-formula-alist nil)) |
| 399 | (if (math-zerop comp) | 399 | (if (math-zerop comp) |
| 400 | (if (setq entry (assq calc-language comps)) | 400 | (if (setq entry (assq calc-language comps)) |
| 401 | (put func 'math-compose-forms (delq entry comps))) | 401 | (put func 'math-compose-forms (delq entry comps))) |
| 402 | (calc-default-formula-arglist comp) | 402 | (calc-default-formula-arglist comp) |
| 403 | (setq arglist (sort arglist 'string-lessp)) | 403 | (setq math-arglist (sort math-arglist 'string-lessp)) |
| 404 | (while | 404 | (while |
| 405 | (progn | 405 | (progn |
| 406 | (setq calc-user-formula-alist | 406 | (setq calc-user-formula-alist |
| 407 | (read-from-minibuffer "Composition argument list: " | 407 | (read-from-minibuffer "Composition argument list: " |
| 408 | (if arglist | 408 | (if math-arglist |
| 409 | (prin1-to-string arglist) | 409 | (prin1-to-string math-arglist) |
| 410 | "()") | 410 | "()") |
| 411 | minibuffer-local-map | 411 | minibuffer-local-map |
| 412 | t)) | 412 | t)) |
| 413 | (and (not (calc-subsetp calc-user-formula-alist arglist)) | 413 | (and (not (calc-subsetp calc-user-formula-alist math-arglist)) |
| 414 | (y-or-n-p | 414 | (y-or-n-p |
| 415 | "Okay for arguments that don't appear in formula to be invisible? ")))) | 415 | "Okay for arguments that don't appear in formula to be invisible? ")))) |
| 416 | (or (setq entry (assq calc-language comps)) | 416 | (or (setq entry (assq calc-language comps)) |