[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 615e12f6 2/2: Simplify implementation of style/tcolorbox.el
From: |
Arash Esbati |
Subject: |
master 615e12f6 2/2: Simplify implementation of style/tcolorbox.el |
Date: |
Thu, 17 Nov 2022 15:29:52 -0500 (EST) |
branch: master
commit 615e12f6505bb73f096daedc2c97164b35780957
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Simplify implementation of style/tcolorbox.el
* style/tcolorbox.el ("tcolorbox"): Replace `TeX-arg-eval' and use
a distinct function for the only argument.
---
style/tcolorbox.el | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/style/tcolorbox.el b/style/tcolorbox.el
index 3f4b415f..03ce9669 100644
--- a/style/tcolorbox.el
+++ b/style/tcolorbox.el
@@ -586,17 +586,16 @@ for example \"tcolorboxlib-raster.el\"."
(TeX-add-symbols
;; 1.3 Libraries
- '("tcbuselibrary"
- (TeX-arg-eval
- (lambda ()
- (let ((libs (mapconcat #'identity
- (TeX-completing-read-multiple
- (TeX-argument-prompt nil nil "Libraries")
- LaTeX-tcolorbox-library-list)
- ",")))
- (LaTeX-add-tcolorbox-tcbuselibraries libs)
- (LaTeX-tcolorbox-load-used-libraries)
- (format "%s" libs)))))
+ `("tcbuselibrary"
+ (TeX-arg-completing-read-multiple LaTeX-tcolorbox-library-list
+ "Libraries")
+ ,(lambda (_)
+ (when (= (preceding-char) (string-to-char TeX-grcl))
+ (save-excursion
+ (re-search-backward "\\\\tcbuselibrary{\\([^}]+\\)}"
+ (line-beginning-position) t)
+ (LaTeX-add-tcolorbox-tcbuselibraries (match-string-no-properties
1))
+ (LaTeX-tcolorbox-load-used-libraries)))))
;; 3 Macros for Box Creation
'("tcblower" 0)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 615e12f6 2/2: Simplify implementation of style/tcolorbox.el,
Arash Esbati <=