(sel-mode): Don't defvar.
(calc-get-stack-element): Add `sel-mode' arg instead.
(calc-top, calc-top-list): Pass it this additional argument.
* lisp/calc/calc-store.el (calc-store-map):
* lisp/calc/calc-map.el (calc-apply, calc-reduce, calc-map)
(calc-map-equation, calc-outer-product, calc-inner-product):
* lisp/calc/calc-aent.el (calc-alg-entry): Don't bind sel-mode.
2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
+ * calc/calc.el: Remove redundant autoload shape check.
+ (sel-mode): Don't defvar.
+ (calc-get-stack-element): Add `sel-mode' arg instead.
+ (calc-top, calc-top-list): Pass it this additional argument.
+ * calc/calc-store.el (calc-store-map):
+ * calc/calc-map.el (calc-apply, calc-reduce, calc-map)
+ (calc-map-equation, calc-outer-product, calc-inner-product):
+ * calc/calc-aent.el (calc-alg-entry): Don't bind sel-mode.
+
* emacs-lisp/macroexp.el (macroexp--expand-all): Fix last change.
2012-09-19 Juri Linkov <juri@jurta.org>
;;;###autoload
(defun calc-alg-entry (&optional initial prompt)
- (let* ((sel-mode nil)
- (calc-dollar-values (mapcar 'calc-get-stack-element
+ (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
(nthcdr calc-stack-top calc-stack)))
(calc-dollar-used 0)
(calc-plain-entry t)
(defun calc-apply (&optional oper)
(interactive)
(calc-wrapper
- (let* ((sel-mode nil)
- (calc-dollar-values (mapcar 'calc-get-stack-element
+ (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
(nthcdr calc-stack-top calc-stack)))
(calc-dollar-used 0)
(oper (or oper (calc-get-operator "Apply"
(defun calc-reduce (&optional oper accum)
(interactive)
(calc-wrapper
- (let* ((sel-mode nil)
- (nest (calc-is-hyperbolic))
+ (let* ((nest (calc-is-hyperbolic))
(rev (calc-is-inverse))
(nargs (if (and nest (not rev)) 2 1))
- (calc-dollar-values (mapcar 'calc-get-stack-element
+ (calc-dollar-values (mapcar #'calc-get-stack-element
(nthcdr calc-stack-top calc-stack)))
(calc-dollar-used 0)
(calc-mapping-dir (and (not accum) (not nest) ""))
(defun calc-map (&optional oper)
(interactive)
(calc-wrapper
- (let* ((sel-mode nil)
- (calc-dollar-values (mapcar 'calc-get-stack-element
+ (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
(nthcdr calc-stack-top calc-stack)))
(calc-dollar-used 0)
(calc-mapping-dir "")
(defun calc-map-equation (&optional oper)
(interactive)
(calc-wrapper
- (let* ((sel-mode nil)
- (calc-dollar-values (mapcar 'calc-get-stack-element
+ (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
(nthcdr calc-stack-top calc-stack)))
(calc-dollar-used 0)
(oper (or oper (calc-get-operator "Map-equation")))
(defun calc-outer-product (&optional oper)
(interactive)
(calc-wrapper
- (let* ((sel-mode nil)
- (calc-dollar-values (mapcar 'calc-get-stack-element
+ (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
(nthcdr calc-stack-top calc-stack)))
(calc-dollar-used 0)
(oper (or oper (calc-get-operator "Outer" 2))))
(defun calc-inner-product (&optional mul-oper add-oper)
(interactive)
(calc-wrapper
- (let* ((sel-mode nil)
- (calc-dollar-values (mapcar 'calc-get-stack-element
+ (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
(nthcdr calc-stack-top calc-stack)))
(calc-dollar-used 0)
(mul-oper (or mul-oper (calc-get-operator "Inner (Mult)" 2)))
(defun calc-store-map (&optional oper var)
(interactive)
(calc-wrapper
- (let* ((sel-mode nil)
- (calc-dollar-values (mapcar 'calc-get-stack-element
+ (let* ((calc-dollar-values (mapcar #'calc-get-stack-element
(nthcdr calc-stack-top calc-stack)))
(calc-dollar-used 0)
(oper (or oper (calc-get-operator "Store Mapping")))
;; Set up the autoloading linkage.
(let ((name (and (fboundp 'calc-dispatch)
- (autoloadp (symbol-function 'calc-dispatch))
- (nth 1 (symbol-function 'calc-dispatch))))
+ (autoloadp (symbol-function 'calc-dispatch))))
(p load-path))
;; If Calc files exist on the load-path, we're all set.
\\{calc-mode-map}
"
(interactive)
- (mapc (function
+ (mapc (function ;FIXME: Why (set-default v (symbol-value v)) ?!?!?
(lambda (v) (set-default v (symbol-value v)))) calc-local-var-list)
(kill-all-local-variables)
(use-local-map (if (eq calc-algebraic-mode 'total)
(progn (require 'calc-ext) calc-alg-map) calc-mode-map))
- (mapc (function (lambda (v) (make-local-variable v))) calc-local-var-list)
+ (mapc #'make-local-variable calc-local-var-list)
(make-local-variable 'overlay-arrow-position)
(make-local-variable 'overlay-arrow-string)
(add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
(if calc-buffer-list (setq calc-stack (copy-sequence calc-stack)))
(add-to-list 'calc-buffer-list (current-buffer) t))
-(defvar calc-check-defines 'calc-check-defines) ; suitable for run-hooks
+(defvar calc-check-defines 'calc-check-defines) ; Suitable for run-hooks.
(defun calc-check-defines ()
(if (symbol-plist 'calc-define)
(let ((plist (copy-sequence (symbol-plist 'calc-define))))
(delete-region (point) (point-max))))
(calc-set-command-flag 'renum-stack))))))
-(defvar sel-mode)
-(defun calc-get-stack-element (x)
+(defun calc-get-stack-element (x &optional sel-mode)
(cond ((eq sel-mode 'entry)
x)
((eq sel-mode 'sel)
(defun calc-top (&optional n sel-mode)
(or n (setq n 1))
(calc-check-stack n)
- (calc-get-stack-element (nth (+ n calc-stack-top -1) calc-stack)))
+ (calc-get-stack-element (nth (+ n calc-stack-top -1) calc-stack) sel-mode))
-(defun calc-top-n (&optional n sel-mode) ; in case precision has changed
+(defun calc-top-n (&optional n sel-mode) ; In case precision has changed.
(math-check-complete (calc-normalize (calc-top n sel-mode))))
(defun calc-top-list (&optional n m sel-mode)
(let ((top (copy-sequence (nthcdr (+ m calc-stack-top -1)
calc-stack))))
(setcdr (nthcdr (1- n) top) nil)
- (nreverse (mapcar 'calc-get-stack-element top)))))
+ (nreverse
+ (mapcar (lambda (x) (calc-get-stack-element x sel-mode)) top)))))
(defun calc-top-list-n (&optional n m sel-mode)
(mapcar 'math-check-complete