mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-30 08:09:04 +00:00
calc/calc-prog.el
calc/calc-graph.el calc/calc-map.el: Change `arglist' to `math-arglist' throughout.
This commit is contained in:
parent
a10c414934
commit
26d82c3ad3
@ -1,3 +1,9 @@
|
||||
2011-01-21 Jay Belanger <jay.p.belanger@gmail.com>
|
||||
|
||||
* calc/calc-prog.el
|
||||
calc/calc-graph.el
|
||||
calc/calc-map.el: Change `arglist' to `math-arglist' throughout.
|
||||
|
||||
2011-01-21 Štěpán Němec <stepnem@gmail.com> (tiny change)
|
||||
|
||||
* calc/calc-ext.el (calc-init-extensions): Map all `undo'
|
||||
|
@ -575,16 +575,16 @@
|
||||
(setq calc-graph-xstep 1)
|
||||
(error "%s is not a suitable basis for %s" calc-graph-xname calc-graph-yname)))))
|
||||
(or (math-realp calc-graph-yvalue)
|
||||
(let ((arglist nil))
|
||||
(let ((math-arglist nil))
|
||||
(setq calc-graph-yvalue (math-evaluate-expr calc-graph-yvalue))
|
||||
(calc-default-formula-arglist calc-graph-yvalue)
|
||||
(or arglist
|
||||
(or math-arglist
|
||||
(error "%s does not contain any unassigned variables" calc-graph-yname))
|
||||
(and (cdr arglist)
|
||||
(and (cdr math-arglist)
|
||||
(error "%s contains more than one variable: %s"
|
||||
calc-graph-yname arglist))
|
||||
calc-graph-yname math-arglist))
|
||||
(setq calc-graph-yvalue (math-expr-subst calc-graph-yvalue
|
||||
(math-build-var-name (car arglist))
|
||||
(math-build-var-name (car math-arglist))
|
||||
'(var DUMMY var-DUMMY)))))
|
||||
(setq calc-graph-ycache (assoc calc-graph-yvalue calc-graph-data-cache))
|
||||
(delq calc-graph-ycache calc-graph-data-cache)
|
||||
@ -736,17 +736,17 @@
|
||||
calc-graph-zp calc-graph-yvalue
|
||||
calc-graph-xvec t))
|
||||
(or (math-realp calc-graph-yvalue)
|
||||
(let ((arglist nil))
|
||||
(let ((math-arglist nil))
|
||||
(setq calc-graph-yvalue (math-evaluate-expr calc-graph-yvalue))
|
||||
(calc-default-formula-arglist calc-graph-yvalue)
|
||||
(setq arglist (sort arglist 'string-lessp))
|
||||
(or (cdr arglist)
|
||||
(setq math-arglist (sort math-arglist 'string-lessp))
|
||||
(or (cdr math-arglist)
|
||||
(error "%s does not contain enough unassigned variables" calc-graph-yname))
|
||||
(and (cdr (cdr arglist))
|
||||
(error "%s contains too many variables: %s" calc-graph-yname arglist))
|
||||
(and (cdr (cdr math-arglist))
|
||||
(error "%s contains too many variables: %s" calc-graph-yname math-arglist))
|
||||
(setq calc-graph-yvalue (math-multi-subst calc-graph-yvalue
|
||||
(mapcar 'math-build-var-name
|
||||
arglist)
|
||||
math-arglist)
|
||||
'((var DUMMY var-DUMMY)
|
||||
(var DUMMY2 var-DUMMY2))))))
|
||||
(if (setq calc-graph-xvec (eq (car-safe calc-graph-xvalue) 'vec))
|
||||
|
@ -572,7 +572,7 @@
|
||||
(and nargs forcenargs (/= nargs forcenargs) (>= nargs 0)
|
||||
(error "Must be a %d-argument operator" nargs)))
|
||||
((memq key '(?\$ ?\'))
|
||||
(let* ((arglist nil)
|
||||
(let* ((math-arglist nil)
|
||||
(has-args nil)
|
||||
(record-entry nil)
|
||||
(expr (if (eq key ?\$)
|
||||
@ -592,13 +592,13 @@
|
||||
(if (> calc-dollar-used 0)
|
||||
(progn
|
||||
(setq has-args calc-dollar-used
|
||||
arglist (calc-invent-args has-args))
|
||||
math-arglist (calc-invent-args has-args))
|
||||
(math-multi-subst (car func)
|
||||
(reverse arglist)
|
||||
arglist))
|
||||
(reverse math-arglist)
|
||||
math-arglist))
|
||||
(if (> calc-hashes-used 0)
|
||||
(setq has-args calc-hashes-used
|
||||
arglist (calc-invent-args has-args)))
|
||||
math-arglist (calc-invent-args has-args)))
|
||||
(car func))))))
|
||||
(if (eq (car-safe expr) 'calcFunc-lambda)
|
||||
(setq oper (list "$" (- (length expr) 2) expr)
|
||||
@ -607,16 +607,16 @@
|
||||
(progn
|
||||
(calc-default-formula-arglist expr)
|
||||
(setq record-entry t
|
||||
arglist (sort arglist 'string-lessp))
|
||||
math-arglist (sort math-arglist 'string-lessp))
|
||||
(if calc-verify-arglist
|
||||
(setq arglist (read-from-minibuffer
|
||||
(setq math-arglist (read-from-minibuffer
|
||||
"Function argument list: "
|
||||
(if arglist
|
||||
(prin1-to-string arglist)
|
||||
(if math-arglist
|
||||
(prin1-to-string math-arglist)
|
||||
"()")
|
||||
minibuffer-local-map
|
||||
t)))
|
||||
(setq arglist (mapcar (function
|
||||
(setq math-arglist (mapcar (function
|
||||
(lambda (x)
|
||||
(list 'var
|
||||
x
|
||||
@ -624,10 +624,10 @@
|
||||
(concat
|
||||
"var-"
|
||||
(symbol-name x))))))
|
||||
arglist))))
|
||||
math-arglist))))
|
||||
(setq oper (list "$"
|
||||
(length arglist)
|
||||
(append '(calcFunc-lambda) arglist
|
||||
(length math-arglist)
|
||||
(append '(calcFunc-lambda) math-arglist
|
||||
(list expr)))
|
||||
done t))
|
||||
(if record-entry
|
||||
|
@ -171,17 +171,17 @@
|
||||
(interactive)
|
||||
(calc-wrapper
|
||||
(let* ((form (calc-top 1))
|
||||
(arglist nil)
|
||||
(math-arglist nil)
|
||||
(is-lambda (and (eq (car-safe form) 'calcFunc-lambda)
|
||||
(>= (length form) 2)))
|
||||
odef key keyname cmd cmd-base cmd-base-default
|
||||
func calc-user-formula-alist is-symb)
|
||||
(if is-lambda
|
||||
(setq arglist (mapcar (function (lambda (x) (nth 1 x)))
|
||||
(setq math-arglist (mapcar (function (lambda (x) (nth 1 x)))
|
||||
(nreverse (cdr (reverse (cdr form)))))
|
||||
form (nth (1- (length form)) form))
|
||||
(calc-default-formula-arglist form)
|
||||
(setq arglist (sort arglist 'string-lessp)))
|
||||
(setq math-arglist (sort math-arglist 'string-lessp)))
|
||||
(message "Define user key: z-")
|
||||
(setq key (read-char))
|
||||
(if (= (calc-user-function-classify key) 0)
|
||||
@ -267,17 +267,17 @@
|
||||
(format "%05d" (% (random) 10000)))))))
|
||||
|
||||
(if is-lambda
|
||||
(setq calc-user-formula-alist arglist)
|
||||
(setq calc-user-formula-alist math-arglist)
|
||||
(while
|
||||
(progn
|
||||
(setq calc-user-formula-alist
|
||||
(read-from-minibuffer "Function argument list: "
|
||||
(if arglist
|
||||
(prin1-to-string arglist)
|
||||
(if math-arglist
|
||||
(prin1-to-string math-arglist)
|
||||
"()")
|
||||
minibuffer-local-map
|
||||
t))
|
||||
(and (not (calc-subsetp calc-user-formula-alist arglist))
|
||||
(and (not (calc-subsetp calc-user-formula-alist math-arglist))
|
||||
(not (y-or-n-p
|
||||
"Okay for arguments that don't appear in formula to be ignored? "))))))
|
||||
(setq is-symb (and calc-user-formula-alist
|
||||
@ -328,14 +328,14 @@
|
||||
(setcdr kmap (cons (cons key cmd) (cdr kmap)))))))
|
||||
(message "")))
|
||||
|
||||
(defvar arglist) ; dynamically bound in all callers
|
||||
(defvar math-arglist) ; dynamically bound in all callers
|
||||
(defun calc-default-formula-arglist (form)
|
||||
(if (consp form)
|
||||
(if (eq (car form) 'var)
|
||||
(if (or (memq (nth 1 form) arglist)
|
||||
(if (or (memq (nth 1 form) math-arglist)
|
||||
(math-const-var form))
|
||||
()
|
||||
(setq arglist (cons (nth 1 form) arglist)))
|
||||
(setq math-arglist (cons (nth 1 form) math-arglist)))
|
||||
(calc-default-formula-arglist-step (cdr form)))))
|
||||
|
||||
(defun calc-default-formula-arglist-step (l)
|
||||
@ -394,23 +394,23 @@
|
||||
(intern (concat "calcFunc-" x))))))))
|
||||
(comps (get func 'math-compose-forms))
|
||||
entry entry2
|
||||
(arglist nil)
|
||||
(math-arglist nil)
|
||||
(calc-user-formula-alist nil))
|
||||
(if (math-zerop comp)
|
||||
(if (setq entry (assq calc-language comps))
|
||||
(put func 'math-compose-forms (delq entry comps)))
|
||||
(calc-default-formula-arglist comp)
|
||||
(setq arglist (sort arglist 'string-lessp))
|
||||
(setq math-arglist (sort math-arglist 'string-lessp))
|
||||
(while
|
||||
(progn
|
||||
(setq calc-user-formula-alist
|
||||
(read-from-minibuffer "Composition argument list: "
|
||||
(if arglist
|
||||
(prin1-to-string arglist)
|
||||
(if math-arglist
|
||||
(prin1-to-string math-arglist)
|
||||
"()")
|
||||
minibuffer-local-map
|
||||
t))
|
||||
(and (not (calc-subsetp calc-user-formula-alist arglist))
|
||||
(and (not (calc-subsetp calc-user-formula-alist math-arglist))
|
||||
(y-or-n-p
|
||||
"Okay for arguments that don't appear in formula to be invisible? "))))
|
||||
(or (setq entry (assq calc-language comps))
|
||||
|
Loading…
Reference in New Issue
Block a user