[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 21e624026a 28/48: Improve support for TikZ
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 21e624026a 28/48: Improve support for TikZ |
Date: |
Fri, 18 Nov 2022 14:27:44 -0500 (EST) |
branch: externals/auctex
commit 21e624026a250f39a508ec06274fbfa72b99b6a1
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>
Improve support for TikZ
* style/tikz.el ("tikz"): Add "tikz", "tikzset", "usetikzlibrary" and
"foreach" macros.
Run style hooks for graphicx, keyval and xcolor as well.
Include preliminary support for ConTeXt and plain TeX.
Allow optional argument for "tikzpicture" environment.
Add "scope" environment.
(AUCTeX-TikZ): New customize group.
(TeX-TikZ-point-name-regexp): Use it as group.
(TeX-TikZ-find-named-points): Add comment.
(): Add `declare-function'.
---
style/tikz.el | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 58 insertions(+), 3 deletions(-)
diff --git a/style/tikz.el b/style/tikz.el
index 565e6b0aa4..eb7d92810e 100644
--- a/style/tikz.el
+++ b/style/tikz.el
@@ -33,11 +33,19 @@
(require 'tex)
(require 'latex)
+;; Silence compiler
+(declare-function ConTeXt-add-environments "context"
+ (&rest environments))
+
+(defgroup AUCTeX-TikZ nil
+ "AUCTeX TikZ support"
+ :group 'AUCTeX)
+
(defcustom TeX-TikZ-point-name-regexp
"(\\([A-Za-z0-9]+\\))"
"A regexp that matches TikZ names."
:type 'regexp
- :group 'auctex-tikz)
+ :group 'AUCTeX-TikZ)
(defconst TeX-TikZ-point-function-map
'(("Rect Point" TeX-TikZ-arg-rect-point)
@@ -199,6 +207,10 @@ is finished."
Begin by finding the span of the current TikZ enviroment and then
searching within that span to find all named-points and return
them as a list of strings, dropping the \\='()\\='."
+ ;; FIXME: This function depends on `LaTeX-find-matching-begin' and
+ ;; `LaTeX-find-matching-end', so it doesn't work for ConTeXt and
+ ;; plain TeX. In addition, it isn't compatible with the TikZ code
+ ;; following \tikz.
(let* ((env-end (save-excursion
(LaTeX-find-matching-end)
(point)))
@@ -278,8 +290,51 @@ return \"\"."
(TeX-add-symbols
'("draw" (TeX-TikZ-draw-arg))
'("coordinate" (TeX-TikZ-coordinate-arg))
- '("node" (TeX-TikZ-node-arg)))
+ '("node" (TeX-TikZ-node-arg))
+ '("tikz" ["TikZ option"])
+ '("tikzset" "TikZ option")
+ ;; FIXME:
+ ;; 1. usetikzlibrary isn't much useful without completion support
+ ;; for available libraries.
+ ;; 2. ConTeXt users may prefer [...] over {...} as the argument.
+ '("usetikzlibrary" t)
+ ;; XXX: Maybe we should create pgffor.el and factor out this entry
+ ;; into it.
+ '("foreach" (TeX-arg-literal " ") (TeX-arg-free "Variable(s)")
+ (TeX-arg-literal " ") ["Foreach option"]
+ (TeX-arg-literal " in ") "Value list (Use \"...\" for range)"
+ (TeX-arg-literal " ") t))))
+
+;; LaTeX/docTeX specific stuff
+(TeX-add-style-hook
+ "tikz"
+ (lambda ()
(LaTeX-add-environments
- '("tikzpicture"))))
+ '("tikzpicture" ["TikZ option"])
+ '("scope" ["TikZ option"]))
+ ;; tikz.sty loads pgfcore.sty, which loads packages graphicx,
+ ;; keyval and xcolor, too.
+ (TeX-run-style-hooks "pgf" "graphicx" "keyval" "xcolor"))
+ :latex)
+
+;; ConTeXt specific stuff
+(TeX-add-style-hook
+ "tikz"
+ (lambda ()
+ (ConTeXt-add-environments
+ '("tikzpicture" ["TikZ option"])
+ '("scope" ["TikZ option"])))
+ :context)
+
+;; plain TeX specific stuff
+(TeX-add-style-hook
+ "tikz"
+ (lambda ()
+ (TeX-add-symbols
+ '("tikzpicture" ["TikZ option"])
+ "endtikzpicture"
+ '("scope" ["TikZ option"])
+ "endscope"))
+ :plain-tex)
;;; tikz.el ends here
- [elpa] externals/auctex cb7b44227d 31/48: Improve fontification of indexing macros, (continued)
- [elpa] externals/auctex cb7b44227d 31/48: Improve fontification of indexing macros, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex c525dd42dd 35/48: Simplify implementation of style/tcolorboxlib-raster.el, 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 487c91fddb 04/48: ; Pacify compiler warning: Unused lexical argument `ignored', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex ce15e3fd87 24/48: Extend Japanese TeX support, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 52a7f4050f 27/48: ; * doc/auctex.texi (Adding Environments): Adjust indentation., Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 42150568f1 06/48: Allow user to insert "$" (bug#57626), Tassilo Horn, 2022/11/18
- [elpa] externals/auctex cdf57fba58 11/48: * latex.el (TeX-arg-conditional): Declare 'indent'., Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 4eaed332ba 26/48: Add new hooks for inserting environments with arguments, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex d7e6fa0d41 05/48: Cleanup `TeX-insert-dollar', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 21e624026a 28/48: Improve support for TikZ,
Tassilo Horn <=
- [elpa] externals/auctex e53bb19a90 37/48: ; Recognize large arguments with many lines, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 9b365b7419 18/48: Simplify implementation of style/textpos.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 05cd0440c5 02/48: Use `TeX-arg-completing-read-multiple', 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 615e12f650 42/48: Simplify implementation of style/tcolorbox.el, 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 8e3137f641 15/48: Simplify implementation of style/titlesec.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 20cabef81f 20/48: ; Delete unnecessary `TeX-arg-string', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 49987f08dd 19/48: Provide completion candidates for `TeX-arg-length', Tassilo Horn, 2022/11/18