branch: externals/auctex commit cebf8cc1e534d6fa5e883b5a874a6a37e32a9b88 Author: Tassilo Horn <t...@gnu.org> Commit: Tassilo Horn <t...@gnu.org>
Enable lexical-binding for texmathp.el * texmathp.el (texmathp-compile): Use `push' on places rather than `set' and `symbol-value' on locals partly pointing to symbols naming globals. --- texmathp.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/texmathp.el b/texmathp.el index 733f639..37658f3 100644 --- a/texmathp.el +++ b/texmathp.el @@ -1,4 +1,4 @@ -;;; texmathp.el -- Code to check if point is inside LaTeX math environment +;;; texmathp.el -- Code to check if point is inside LaTeX math environment -*- lexical-binding: t; -*- ;; Copyright (C) 1998, 2004, 2017, 2020 Free Software Foundation, Inc. @@ -181,15 +181,14 @@ customize (customize calls it when setting the variable)." (setq texmathp-tex-commands1 (append texmathp-tex-commands texmathp-tex-commands-default)) (let ((list (reverse texmathp-tex-commands1)) - var entry type switches togglers) + entry type switches togglers) (while (setq entry (car list)) (setq type (nth 1 entry) - list (cdr list) - var (cond ((memq type '(env-on env-off)) 'texmathp-environments) - ((memq type '(arg-on arg-off)) 'texmathp-macros) - ((memq type '(sw-on sw-off)) 'switches) - ((memq type '(sw-toggle)) 'togglers))) - (set var (cons (car entry) (symbol-value var)))) + list (cdr list)) + (cond ((memq type '(env-on env-off)) (push (car entry) texmathp-environments)) + ((memq type '(arg-on arg-off)) (push (car entry) texmathp-macros)) + ((memq type '(sw-on sw-off)) (push (car entry) switches)) + ((memq type '(sw-toggle)) (push (car entry) togglers)))) (setq texmathp-onoff-regexp (concat "\\(?:[^\\]\\|\\`\\)" (regexp-opt switches t))