From 0fac3f55325cf33e797b33be9935bf39f344c7c9 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 14 Oct 2020 18:03:52 -0400 Subject: * lisp/calc: Fix a few issues introduced by lexical scoping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a few places I missed, where we incorrectly used lexical scoping on a var that needed dynamic scoping. These were detected thanks to a bit of footwork by Mattias EngdegÄrd! * lisp/calc/calc-ext.el (math-read-big-lines): Declare as dynbound. (math-read-big-bigp): Bind it inside a `let`. * lisp/calc/calc-graph.el (math-arglist): Declare as dynbound. * lisp/calc/calc-map.el (math-arglist): Declare as dynbound. * lisp/calc/calc-misc.el (math-trunc-prec): Declare as dynbound. (math-trunc): Bind it inside a `let`. (math-floor-prec): Declare as dynbound. (math-floor): Bind it inside a `let`. * lisp/calc/calc-nlfit.el (calc-curve-varnames, calc-curve-coefnames): Declare as dynbound. * lisp/calc/calc-sel.el (math-comp-sel-tag): Declare as dynbound. * lisp/calc/calcsel2.el (calc-sel-reselect): Declare as dynbound. --- lisp/calc/calc-sel.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/calc/calc-sel.el') diff --git a/lisp/calc/calc-sel.el b/lisp/calc/calc-sel.el index d2944488870..23c0e01b527 100644 --- a/lisp/calc/calc-sel.el +++ b/lisp/calc/calc-sel.el @@ -419,6 +419,7 @@ ;; The variable math-comp-sel-tag is local to calc-find-selected-part, ;; but is used by math-comp-sel-flat-term and math-comp-add-string-sel ;; in calccomp.el, which are called (indirectly) by calc-find-selected-part. +(defvar math-comp-sel-tag) (defun calc-find-selected-part () (let* ((math-comp-sel-hpos (- (current-column) calc-selection-cache-offset)) @@ -437,7 +438,8 @@ (current-indentation)) lcount (1+ lcount))) (- lcount (math-comp-ascent - calc-selection-cache-comp) -1)))) + calc-selection-cache-comp) + -1)))) (math-comp-sel-cpos (- (point) toppt calc-selection-cache-offset spaces lcount)) (math-comp-sel-tag nil)) -- cgit v1.2.3