[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex e4ceb88bb7 14/76: Bind a value to `LaTeX-current
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex e4ceb88bb7 14/76: Bind a value to `LaTeX-current-environment' locally |
Date: |
Fri, 13 Jan 2023 14:30:44 -0500 (EST) |
branch: externals/auctex
commit e4ceb88bb7cb4f406874de196aa71118449fe373
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Bind a value to `LaTeX-current-environment' locally
* latex.el (LaTeX-current-environment): Add docstring.
(LaTeX-env-item-args, LaTeX-env-label-args, LaTeX-env-args):
Let-bind `LaTeX-current-environment' in the function body.
---
latex.el | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/latex.el b/latex.el
index 744257e3c9..ab6dcdc79b 100644
--- a/latex.el
+++ b/latex.el
@@ -568,11 +568,11 @@ Styles such as tabularx may set it according to their
needs.")
(defvar LaTeX-environment-history nil)
-;; Variable used to cache the current environment, e.g. for repeated
-;; tasks in an environment, like indenting each line in a paragraph to
-;; be filled. It must not have a non-nil value in general. That
-;; means it is usually let-bound for such operations.
-(defvar LaTeX-current-environment nil)
+(defvar LaTeX-current-environment nil
+ "Cache holding the name of current enviroment for repeated tasks.
+Example for a repeated task is indenting each line in a paragraph
+to be filled. Therefore, this variable is meant to be let-bound
+in a function and nil globally.")
(defun LaTeX-environment (arg)
"Make LaTeX environment (\\begin{...}-\\end{...} pair).
@@ -1110,9 +1110,10 @@ The first item is inserted by the function
`LaTeX--env-item'."
(defun LaTeX-env-item-args (environment &rest args)
"Insert ENVIRONMENT followed by ARGS and first item.
The first item is inserted by the function `LaTeX--env-item'."
- (LaTeX-insert-environment environment)
- (LaTeX--env-parse-args args)
- (LaTeX--env-item environment))
+ (let ((LaTeX-current-environment environment))
+ (LaTeX-insert-environment environment)
+ (LaTeX--env-parse-args args)
+ (LaTeX--env-item environment)))
(defcustom LaTeX-label-alist
'(("figure" . LaTeX-figure-label)
@@ -1324,8 +1325,9 @@ Just like array and tabular."
(defun LaTeX-env-label-args (environment &rest args)
"Run `LaTeX-env-label' on ENVIRONMENT and insert ARGS."
- (LaTeX-env-label environment)
- (LaTeX--env-parse-args args))
+ (let ((LaTeX-current-environment environment))
+ (LaTeX-env-label environment)
+ (LaTeX--env-parse-args args)))
(defun LaTeX-env-list (environment)
"Insert ENVIRONMENT and the first item."
@@ -1452,8 +1454,9 @@ Just like array and tabular."
(defun LaTeX-env-args (environment &rest args)
"Insert ENVIRONMENT and arguments defined by ARGS."
- (LaTeX-insert-environment environment)
- (LaTeX--env-parse-args args))
+ (let ((LaTeX-current-environment environment))
+ (LaTeX-insert-environment environment)
+ (LaTeX--env-parse-args args)))
(defun LaTeX-env-label-as-keyval (_optional &optional keyword keyvals
environment)
"Query for a label and insert it in the optional argument of an environment.
- [elpa] externals/auctex 2664170ecc 37/76: Update style/fvextra.el to package version 1.5, (continued)
- [elpa] externals/auctex 2664170ecc 37/76: Update style/fvextra.el to package version 1.5, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 5f129b5dca 58/76: Support starred variant name, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex e97fb94f4e 62/76: Pacify compiler warning, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex bf66b302a4 61/76: Improve the previous commit slightly, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex b7b498baad 40/76: Simplify implementation of style/graphicx.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 7f9e7ec8a1 05/76: * style/array.el ("array"): Replace `TeX-arg-eval' with a closure., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 1a72c0f884 32/76: Simplify implementation of style/floatrow.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex ac7ad4fff4 36/76: Simplify implementation of style/footmisc.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 33bb54bb9e 38/76: Simplify implementation of style/geometry.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex dc6e8c44c9 72/76: Turn `y-or-n-p' into `always' for in-buffer completion, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex e4ceb88bb7 14/76: Bind a value to `LaTeX-current-environment' locally,
Tassilo Horn <=
- [elpa] externals/auctex 4b9dafad86 29/76: Simplify implementation of style/fancyvrb.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 982b20571c 48/76: * style/ltxdoc.el ("ltxdoc"): Replace `TeX-arg-eval'., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 46c1a5a592 63/76: Add filename as a prefix to catchfilebetweentags counter, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 2d0fdebac0 69/76: Preserve braces after @TeX and similar macros., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 30bca31f77 71/76: ; * style/xcolor.el ("xcolor"): Replace `TeX-arg-eval'., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 643d39a10c 75/76: Update Pygments style names, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 3806176ba2 56/76: Fix argument description in doc strings, Tassilo Horn, 2023/01/13