[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-devel] [PATCH 2/5] TikZ: allow arg type prompt to be specified.
From: |
Matthew Leach |
Subject: |
[AUCTeX-devel] [PATCH 2/5] TikZ: allow arg type prompt to be specified. |
Date: |
Sun, 27 Mar 2016 19:04:28 +0100 |
* style/tikz.el (TeX-TikZ-get-arg-type): Add a new optional argument,
prompt, and show that to the user when non-nil, instead of the
default.
---
style/tikz.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/style/tikz.el b/style/tikz.el
index f5e11b1..d7857b0 100644
--- a/style/tikz.el
+++ b/style/tikz.el
@@ -94,10 +94,14 @@ string \"node[OPTIONS](NAME){TEXT}\"."
(text (TeX-TikZ-arg-text nil)))
(concat "node" options name text " ")))
-(defun TeX-TikZ-get-arg-type (types)
- "Prompt the user for the next argument type.
-TYPES is a list of possible types that the user can specify."
- (completing-read "Next argument type (RET to finish): " types nil t))
+(defun TeX-TikZ-get-arg-type (types &optional prompt)
+ "Prompt the user for an argument type.
+TYPES is a list of possible types that the user can specify. If
+PROMPT is non-nil use that prompt instead."
+ (let ((prompt (if prompt
+ prompt
+ "Next argument type (RET to finish): ")))
+ (completing-read prompt types nil t)))
(defun TeX-TikZ-macro-arg (function-alist)
"Prompt the user for arguments to compose a TikZ macro.
--
2.7.4