emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] elpa ae6ed8b 06/51: TikZ: make `TeX-TikZ-single-macro-arg' prompt


From: Tassilo Horn
Subject: [elpa] elpa ae6ed8b 06/51: TikZ: make `TeX-TikZ-single-macro-arg' prompt required.
Date: Sun, 22 May 2016 07:22:47 +0000 (UTC)

branch: elpa
commit ae6ed8b21742ae50189084e4a2d95baebb87052b
Author: Matthew Leach <address@hidden>
Commit: Matthew Leach <address@hidden>

    TikZ: make `TeX-TikZ-single-macro-arg' prompt required.
    
    * style/tikz.el (TeX-TikZ-get-arg-type): Make prompt non-optional.
      (TeX-TikZ-single-macro-arg): Likewise.
      (TeX-TikZ-macro-arg): Make prompt explicit.
---
 style/tikz.el |   18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/style/tikz.el b/style/tikz.el
index b29abf8..d335cbc 100644
--- a/style/tikz.el
+++ b/style/tikz.el
@@ -94,17 +94,14 @@ string \"node[OPTIONS](NAME){TEXT}\"."
         (label (TeX-TikZ-arg-label nil)))
     (concat "node" options name label " ")))
 
-(defun TeX-TikZ-get-arg-type (types &optional prompt)
+(defun TeX-TikZ-get-arg-type (types 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 ((completion-ignore-case t)
-        (prompt (if prompt
-                    prompt
-                  "Next argument type (RET to finish): ")))
+TYPES is a list of possible types that the user can specify.  Use
+PROMPT as the prompt for input."
+  (let ((completion-ignore-case t))
     (completing-read prompt types nil t)))
 
-(defun TeX-TikZ-single-macro-arg (function-alist &optional prompt)
+(defun TeX-TikZ-single-macro-arg (function-alist prompt)
   "Prompt the user for a single argument to compose a TikZ macro.
 FUNCTION-ALIST is a mapping of argument-types to functions.  The
 user is prompted for the argument type, the chosen function is
@@ -128,7 +125,8 @@ is finished."
          ;; For the iterative version, we need to add "" to the
          ;; function-alist, allowing the user to end the macro.
          (function-alist-iterative `(,@function-alist ("" identity)))
-         (string-to-insert (TeX-TikZ-single-macro-arg 
function-alist-iterative)))
+         (prompt "Next argument type (RET to finish): ")
+         (string-to-insert (TeX-TikZ-single-macro-arg function-alist-iterative 
prompt)))
 
     ;; Insert the macro options.
     (insert options " ")
@@ -138,7 +136,7 @@ is finished."
     (while (not (string= string-to-insert ""))
       (insert string-to-insert)
       (setq string-to-insert
-            (TeX-TikZ-single-macro-arg function-alist-iterative)))
+            (TeX-TikZ-single-macro-arg function-alist-iterative prompt)))
 
     ;; Finish the macro.
     (insert ";")))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]