summaryrefslogtreecommitdiff
path: root/lisp/calc/calc-sel.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2020-10-14 18:03:52 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2020-10-14 18:03:52 -0400
commit0fac3f55325cf33e797b33be9935bf39f344c7c9 (patch)
tree4fd9dc7fdace60642f3f179d75f54ba15489d6a9 /lisp/calc/calc-sel.el
parent423439b38067c4a428310edab24fba7da082027c (diff)
downloademacs-0fac3f55325cf33e797b33be9935bf39f344c7c9.tar.gz
emacs-0fac3f55325cf33e797b33be9935bf39f344c7c9.tar.bz2
emacs-0fac3f55325cf33e797b33be9935bf39f344c7c9.zip
* lisp/calc: Fix a few issues introduced by lexical scoping
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.
Diffstat (limited to 'lisp/calc/calc-sel.el')
-rw-r--r--lisp/calc/calc-sel.el4
1 files changed, 3 insertions, 1 deletions
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))