[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex c525dd42dd 35/48: Simplify implementation of sty
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex c525dd42dd 35/48: Simplify implementation of style/tcolorboxlib-raster.el |
Date: |
Fri, 18 Nov 2022 14:27:44 -0500 (EST) |
branch: externals/auctex
commit c525dd42dd2660c18c49dc1484911666502ae2ea
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Simplify implementation of style/tcolorboxlib-raster.el
* style/tcolorboxlib-raster.el ("tcolorboxlib-raster"): Use
`LaTeX-env-args' and `LaTeX-env-item-args' in the hook and
subsequently delete `LaTeX-tcolorbox-lib-raster-env-item'.
---
style/tcolorboxlib-raster.el | 101 ++++++++++++-------------------------------
1 file changed, 27 insertions(+), 74 deletions(-)
diff --git a/style/tcolorboxlib-raster.el b/style/tcolorboxlib-raster.el
index db61a03491..1d67761bc1 100644
--- a/style/tcolorboxlib-raster.el
+++ b/style/tcolorboxlib-raster.el
@@ -1,6 +1,6 @@
;;; tcolorboxlib-raster.el --- AUCTeX style for `raster' library from
tcolorbox -*- lexical-binding: t; -*-
-;; Copyright (C) 2016--2021 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2022 Free Software Foundation, Inc.
;; Author: Arash Esbati <arash@gnu.org>
;; Maintainer: auctex-devel@gnu.org
@@ -84,47 +84,6 @@
("raster multirow"))
"Key=value options for raster library from tcolorbox.")
-(defun LaTeX-tcolorbox-lib-raster-env-item (environment)
- "Insert ENVIRONMENT, ask for arguments and the first item."
- (LaTeX-insert-environment
- environment
- (let ((opts (TeX-read-key-val t (append
- LaTeX-tcolorbox-lib-raster-keyval-options
- (LaTeX-tcolorbox-keyval-options))
- (when (string= environment "tcboxeditemize")
- "Raster options (k=v)")))
- (box-opts (when (string= environment "tcboxeditemize")
- (TeX-read-key-val nil (LaTeX-tcolorbox-keyval-options)
- "Box options (k=v)"))))
- (concat
- (when (and opts (not (string= opts "")))
- (format "[%s]" opts))
- (when (string= environment "tcboxeditemize")
- (format "{%s}" box-opts)))))
- (if (TeX-active-mark)
- (progn
- (LaTeX-find-matching-begin)
- (end-of-line 1))
- (end-of-line 0))
- (delete-char 1)
- (when (looking-at (concat "^[ \t]+$\\|"
- "^[ \t]*" TeX-comment-start-regexp "+[ \t]*$"))
- (delete-region (point) (line-end-position)))
- (delete-horizontal-space)
- ;; Deactivate the mark here in order to prevent `TeX-parse-macro'
- ;; from swapping point and mark and the \item ending up right after
- ;; \begin{...}.
- (deactivate-mark)
- (LaTeX-insert-item)
- ;; The inserted \item may have outdented the first line to the
- ;; right. Fill it, if appropriate.
- (when (and auto-fill-function
- (not (looking-at "$"))
- (not (assoc environment LaTeX-indent-environment-list))
- (> (- (line-end-position) (line-beginning-position))
- (current-fill-column)))
- (LaTeX-fill-paragraph nil)))
-
(defun LaTeX-tcolorbox-lib-raster-insert-item ()
"Insert \"tcbitem\" and query for optional argument."
(TeX-insert-macro "tcbitem"))
@@ -140,42 +99,36 @@
(TeX-add-symbols
;; 14.2 Macros of the Library
'("tcbitem"
- [TeX-arg-key-val (LaTeX-tcolorbox-keyval-options) "Item options (k=v)" ]
+ [TeX-arg-key-val (LaTeX-tcolorbox-keyval-options) "Item options"]
(TeX-arg-literal " ")))
(LaTeX-add-environments
;; 14.2 Macros of the Library
- '("tcbraster"
- (lambda (env)
- (LaTeX-insert-environment
- env
- (let ((raster-opts
- (TeX-read-key-val t (append
- LaTeX-tcolorbox-lib-raster-keyval-options
- (LaTeX-tcolorbox-keyval-options)))))
- (when (and raster-opts (not (string= raster-opts "")))
- (concat LaTeX-optop raster-opts LaTeX-optcl))))))
-
- '("tcbitemize" LaTeX-tcolorbox-lib-raster-env-item)
-
- '("tcboxedraster"
- (lambda (env)
- (LaTeX-insert-environment
- env
- (let ((raster-opts
- (TeX-read-key-val t (append
- LaTeX-tcolorbox-lib-raster-keyval-options
- (LaTeX-tcolorbox-keyval-options))
- "Raster options (k=v)"))
- (box-opts
- (TeX-read-key-val nil (LaTeX-tcolorbox-keyval-options)
- "Box options (k=v)")))
- (concat
- (when (and raster-opts (not (string= raster-opts "")))
- (concat LaTeX-optop raster-opts LaTeX-optcl))
- TeX-grop box-opts TeX-grcl)))))
-
- '("tcboxeditemize" LaTeX-tcolorbox-lib-raster-env-item))
+ `("tcbraster" LaTeX-env-args
+ [TeX-arg-key-val ,(lambda ()
+ (append LaTeX-tcolorbox-lib-raster-keyval-options
+ (LaTeX-tcolorbox-keyval-options)))])
+
+ `("tcbitemize" LaTeX-env-item-args
+ [TeX-arg-key-val ,(lambda ()
+ (append LaTeX-tcolorbox-lib-raster-keyval-options
+ (LaTeX-tcolorbox-keyval-options)))])
+
+ `("tcboxedraster" LaTeX-env-args
+ [TeX-arg-key-val ,(lambda ()
+ (append LaTeX-tcolorbox-lib-raster-keyval-options
+ (LaTeX-tcolorbox-keyval-options)))
+ "Raster options"]
+ (TeX-arg-key-val (LaTeX-tcolorbox-keyval-options)
+ "Box options"))
+
+ `("tcboxeditemize" LaTeX-env-item-args
+ [TeX-arg-key-val ,(lambda ()
+ (append LaTeX-tcolorbox-lib-raster-keyval-options
+ (LaTeX-tcolorbox-keyval-options)))
+ "Raster options"]
+ (TeX-arg-key-val (LaTeX-tcolorbox-keyval-options)
+ "Box options")))
;; Append tcb(oxed)?itemize to `LaTeX-item-list':
(add-to-list 'LaTeX-item-list
- [elpa] externals/auctex c6c7c3f024 22/48: ; Use #' to quote function, (continued)
- [elpa] externals/auctex c6c7c3f024 22/48: ; Use #' to quote function, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 8e3137f641 15/48: Simplify implementation of style/titlesec.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 1f6e9e7e58 10/48: Update style/XCharter.el to package version 1.24, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 748449959c 21/48: New option `TeX-refuse-unmatched-dollar', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex ff5a83f345 17/48: Simplify implementation of style/thm-restate.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex ce15e3fd87 24/48: Extend Japanese TeX support, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 20cabef81f 20/48: ; Delete unnecessary `TeX-arg-string', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 21e624026a 28/48: Improve support for TikZ, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 316550f0bf 29/48: Fix `ConTeXt-add-environments', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 0c482642cc 32/48: Simplify implementation of style/currvita.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex c525dd42dd 35/48: Simplify implementation of style/tcolorboxlib-raster.el,
Tassilo Horn <=
- [elpa] externals/auctex a7a7209a08 33/48: Extend the argument list of some functions, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex b9548da54a 38/48: Simplify implementation of style/tcolorboxlib-theorems.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 50c0fb3d31 46/48: * style/afterpage.el ("afterpage"): Fontify the only macro., Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 93430d7ab0 48/48: Merge remote-tracking branch 'origin/master' into externals/auctex, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 05cd0440c5 02/48: Use `TeX-arg-completing-read-multiple', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 7642155b73 03/48: Don't let-bind `inhibit-point-motion-hooks' to t, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex a617944b4b 08/48: Fix style/xspace.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 5949388ca2 12/48: Simplify argument queries in style/wrapfig.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex e83a4b87b3 25/48: Use the correct function to retrieve the key=vals, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 35ec84ba6f 07/48: Add capf for LaTeX marco/environment arguments, Tassilo Horn, 2022/11/18