branch: elpa commit 4770a356b8ce771b09c5ebd3286c15d0f20c2e17 Author: Matthew Leach <matt...@mattleach.net> Commit: Matthew Leach <matt...@mattleach.net>
TikZ: Add prompting for TikZ's \node macro. * style/tikz.el (TeX-TikZ-node-arg): New. --- style/tikz.el | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/style/tikz.el b/style/tikz.el index a877cb8..d002811 100644 --- a/style/tikz.el +++ b/style/tikz.el @@ -167,11 +167,21 @@ functions.") "Coordinate point type: "))) (insert options " " name " at" point ";"))) +(defun TeX-TikZ-node-arg (optional) + "Prompt the user for the arguments to a TikZ node macro." + (let ((options (TeX-TikZ-arg-options t)) + (name (TeX-TikZ-arg-name nil)) + (point (TeX-TikZ-single-macro-arg TeX-TikZ-point-function-map + "Node point type: ")) + (text (TeX-TikZ-arg-text nil))) + (insert options " " name " at" point text ";"))) + (TeX-add-style-hook "tikz" (lambda () (TeX-add-symbols '("draw" (TeX-TikZ-draw-arg)) - '("coordinate" (TeX-TikZ-coordinate-arg))) + '("coordinate" (TeX-TikZ-coordinate-arg)) + '("node" (TeX-TikZ-node-arg))) (LaTeX-add-environments '("tikzpicture"))))