auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. b66c10aa0ae12d3cf85cb


From: Matthew Leach
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. b66c10aa0ae12d3cf85cb75e097e82bd342278dc
Date: Tue, 05 Apr 2016 11:33:21 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  b66c10aa0ae12d3cf85cb75e097e82bd342278dc (commit)
       via  de0d445ea13a772d9cd842863c4d49217be7553b (commit)
       via  ae6ed8b21742ae50189084e4a2d95baebb87052b (commit)
       via  310008b94765bc324c6fd4813d1994833b4929f9 (commit)
       via  c58162a642a1544dc5757c3ca0aabf80edb0e033 (commit)
      from  e78a13c024937cb0802e05ff8274b0e832925d85 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b66c10aa0ae12d3cf85cb75e097e82bd342278dc
Author: Matthew Leach <address@hidden>
Date:   Mon Apr 4 21:53:06 2016 +0100

    TikZ: Add parabola command.
    
    * style/tikz.el (TeX-TikZ-arg-bend): New.
      (TeX-TikZ-arg-parabola): New.
      (TeX-TikZ-draw-arg-function-map): Add mapping from "Parabola" to
      `TeX-TikZ-arg-parabola'.

diff --git a/style/tikz.el b/style/tikz.el
index 222be06..9754347 100644
--- a/style/tikz.el
+++ b/style/tikz.el
@@ -182,6 +182,24 @@ them as a list of strings, dropping the '()'."
   (let ((options (TeX-TikZ-arg-options t)))
     (concat "arc" options)))
 
+(defun TeX-TikZ-arg-bend (optional)
+  "Prompt the user for a bend argument.
+If OPTIONAL is non-nil and the user doesn't provide a point,
+  return \"\"."
+  (let ((point
+         (TeX-TikZ-single-macro-arg TeX-TikZ-point-function-map
+                                    (TeX-argument-prompt optional nil "Bend 
point")
+                                    optional)))
+    (if (string= point "")
+        point
+      (concat " bend" point))))
+
+(defun TeX-TikZ-arg-parabola (_ignored)
+  "Prompt the user for the arguments to the parabola command."
+  (let ((options (TeX-TikZ-arg-options t))
+        (bend (TeX-TikZ-arg-bend t)))
+       (concat "parabola" options bend)))
+
 (defconst TeX-TikZ-point-function-map
   '(("Rect Point" TeX-TikZ-arg-rect-point)
     ("Polar Point" TeX-TikZ-arg-polar-point)
@@ -205,7 +223,8 @@ A set of base connectors along with variants that have \" 
+\" and
     ,@TeX-TikZ-path-connector-function-map
     ("Node" TeX-TikZ-arg-node)
     ("Circle" TeX-TikZ-arg-circle)
-    ("Arc" TeX-TikZ-arg-arc))
+    ("Arc" TeX-TikZ-arg-arc)
+    ("Parabola" TeX-TikZ-arg-parabola))
   "An alist of argument names and functoins for TikZ's \draw.")
 
 (defun TeX-TikZ-draw-arg (_ignored)

commit de0d445ea13a772d9cd842863c4d49217be7553b
Author: Matthew Leach <address@hidden>
Date:   Mon Apr 4 21:38:18 2016 +0100

    TikZ: Add optional parameter to `TeX-TikZ-single-macro-arg'.
    
    * style/tikz.el (TeX-TikZ-single-macro-arg): New argument OPTIONAL.
      (TeX-TikZ-macro-arg): Use OPTIONAL argument when calling
      `TeX-TikZ-single-macro-arg'.

diff --git a/style/tikz.el b/style/tikz.el
index d335cbc..222be06 100644
--- a/style/tikz.el
+++ b/style/tikz.el
@@ -101,14 +101,18 @@ 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 prompt)
+(defun TeX-TikZ-single-macro-arg (function-alist prompt &optional optional)
   "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
 then called and the value returned.  PROMPT is used as the prompt
-for the argument type."
+for the argument type.  When OPTIONAL is non-nil, add \"\" to
+FUNCTION-ALIST with a mapping to `identity', permitting an
+optional input."
   (let* ((argument-types (mapcar 'car function-alist))
          (argument-type (TeX-TikZ-get-arg-type argument-types prompt)))
+    (when optional
+      (setq function-alist `(,@function-alist ("" identity))))
     (funcall
      (cadr (assoc argument-type function-alist))
      argument-type)))
@@ -122,11 +126,8 @@ choose form the cars in FUNCTION-ALIST and the appropriate
 function is then called.  If the user enters \"\", then the macro
 is finished."
   (let* ((options (TeX-TikZ-arg-options t))
-         ;; 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)))
          (prompt "Next argument type (RET to finish): ")
-         (string-to-insert (TeX-TikZ-single-macro-arg function-alist-iterative 
prompt)))
+         (string-to-insert (TeX-TikZ-single-macro-arg function-alist prompt 
t)))
 
     ;; Insert the macro options.
     (insert options " ")
@@ -136,7 +137,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 prompt)))
+            (TeX-TikZ-single-macro-arg function-alist prompt t)))
 
     ;; Finish the macro.
     (insert ";")))

commit ae6ed8b21742ae50189084e4a2d95baebb87052b
Author: Matthew Leach <address@hidden>
Date:   Mon Apr 4 21:32:07 2016 +0100

    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.

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 ";")))

commit 310008b94765bc324c6fd4813d1994833b4929f9
Author: Matthew Leach <address@hidden>
Date:   Mon Apr 4 20:59:38 2016 +0100

    TikZ: Add the arc command.
    
    * style/tikz.el (TeX-TikZ-arg-arc): New.
      (TeX-TikZ-draw-arg-function-map): Map the 'Arc' command to
      `Tex-TikZ-arg-arc'.

diff --git a/style/tikz.el b/style/tikz.el
index d187d24..b29abf8 100644
--- a/style/tikz.el
+++ b/style/tikz.el
@@ -178,6 +178,11 @@ them as a list of strings, dropping the '()'."
   (let ((options (TeX-TikZ-arg-options t)))
     (concat "circle" options)))
 
+(defun TeX-TikZ-arg-arc (_ignored)
+  "Prompt the user for the arguments to the arc command."
+  (let ((options (TeX-TikZ-arg-options t)))
+    (concat "arc" options)))
+
 (defconst TeX-TikZ-point-function-map
   '(("Rect Point" TeX-TikZ-arg-rect-point)
     ("Polar Point" TeX-TikZ-arg-polar-point)
@@ -200,7 +205,8 @@ A set of base connectors along with variants that have \" 
+\" and
   `(,@TeX-TikZ-point-function-map
     ,@TeX-TikZ-path-connector-function-map
     ("Node" TeX-TikZ-arg-node)
-    ("Circle" TeX-TikZ-arg-circle))
+    ("Circle" TeX-TikZ-arg-circle)
+    ("Arc" TeX-TikZ-arg-arc))
   "An alist of argument names and functoins for TikZ's \draw.")
 
 (defun TeX-TikZ-draw-arg (_ignored)

commit c58162a642a1544dc5757c3ca0aabf80edb0e033
Author: Matthew Leach <address@hidden>
Date:   Thu Mar 31 13:37:31 2016 +0100

    TikZ: Add circle command.
    
    * style/tikz.el (TeX-TikZ-arg-circle): New.
      (TeX-TikZ-draw-arg-function-map): Add mapping from 'Circle' to
      `TeX-TikZ-arg-circle'.

diff --git a/style/tikz.el b/style/tikz.el
index be93110..d187d24 100644
--- a/style/tikz.el
+++ b/style/tikz.el
@@ -173,6 +173,11 @@ them as a list of strings, dropping the '()'."
                                      (TeX-TikZ-find-named-points))))
     (concat " (" point-name ") ")))
 
+(defun TeX-TikZ-arg-circle (_ignored)
+  "Prompt the user for the arguments to the circle command."
+  (let ((options (TeX-TikZ-arg-options t)))
+    (concat "circle" options)))
+
 (defconst TeX-TikZ-point-function-map
   '(("Rect Point" TeX-TikZ-arg-rect-point)
     ("Polar Point" TeX-TikZ-arg-polar-point)
@@ -194,7 +199,8 @@ A set of base connectors along with variants that have \" 
+\" and
 (defconst TeX-TikZ-draw-arg-function-map
   `(,@TeX-TikZ-point-function-map
     ,@TeX-TikZ-path-connector-function-map
-    ("Node" TeX-TikZ-arg-node))
+    ("Node" TeX-TikZ-arg-node)
+    ("Circle" TeX-TikZ-arg-circle))
   "An alist of argument names and functoins for TikZ's \draw.")
 
 (defun TeX-TikZ-draw-arg (_ignored)

-----------------------------------------------------------------------

Summary of changes:
 style/tikz.el |   60 ++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 45 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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