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

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

[elpa] 178/299: Add new possible value for `TeX-insert-macro-default-sty


From: Stefan Monnier
Subject: [elpa] 178/299: Add new possible value for `TeX-insert-macro-default-style'.
Date: Sun, 02 Nov 2014 03:11:16 +0000

monnier pushed a commit to branch externals/auctex
in repository elpa.

commit 66a0dc8cd45bb535384c157a68147d59035405a2
Author: Mosè Giordano <address@hidden>
Date:   Sun Oct 6 20:48:54 2013 +0200

    Add new possible value for `TeX-insert-macro-default-style'.
    
    * tex.el (TeX-insert-macro-default-style): Add new possible value
    `show-all-optional-args' and update doc-string accordingly.
    (TeX-parse-arguments): Use it.
    
    * doc/auctex.texi (Completion): Document `show-all-optional-args'.
    
    * doc/changes.texi: Mention `show-all-optional-args'.
---
 ChangeLog        |    8 ++++++++
 doc/auctex.texi  |   13 ++++++++-----
 doc/changes.texi |    4 +++-
 tex.el           |   25 ++++++++++++++++---------
 4 files changed, 35 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4093ce3..1db1fb3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2013-10-06  Mos� Giordano  <address@hidden>
 
+       * tex.el (TeX-insert-macro-default-style): Add new possible value
+       `show-all-optional-args' and update doc-string accordingly.
+       (TeX-parse-arguments): Use it.
+
+       * doc/auctex.texi (Completion): Document `show-all-optional-args'.
+
+       * doc/changes.texi: Mention `show-all-optional-args'.
+
        * tex.el (TeX-insert-braces-alist): New customizable variable.
        (TeX-insert-braces): Mention it in doc-string.
        (TeX-parse-macro): Use `TeX-insert-braces-alist'.
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 4156a0b..052ca42 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -1063,13 +1063,16 @@ Specifies whether @code{TeX-insert-macro} will ask for 
all optional
 arguments.
 
 If set to the symbol @code{show-optional-args}, @code{TeX-insert-macro}
-asks for optional arguments of @TeX{} macros.  If set to
address@hidden, @code{TeX-insert-macro} asks only for
-mandatory arguments.  When @code{TeX-insert-macro} is called with prefix
-argument (@kbd{C-u}), it's the other way round.
+asks for optional arguments of @TeX{} marcos, unless the previous
+optional argument has been rejected.  If set to
address@hidden, @code{TeX-insert-macro} asks for all
+optional arguments.  @code{mandatory-args-only}, @code{TeX-insert-macro}
+asks only for mandatory arguments.  When @code{TeX-insert-macro} is
+called with prefix argument (@kbd{C-u}), it's the other way round.
 
 Note that for some macros, there are special mechanisms, e.g.
address@hidden
address@hidden and
address@hidden
 
 @end defopt
 
diff --git a/doc/changes.texi b/doc/changes.texi
index df69cb4..183ff82 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -31,7 +31,9 @@ provided as well.
 
 @item
 New user options @code{LaTeX-default-author} and
address@hidden
address@hidden  A new possible value
+(@code{show-all-optional-args}) for
address@hidden was added.
 
 @item
 @samp{biblatex} support was greatly expanded.  If parsing is enabled,
diff --git a/tex.el b/tex.el
index 1ab9647..0541acf 100644
--- a/tex.el
+++ b/tex.el
@@ -2611,18 +2611,22 @@ the variable `TeX-insert-braces'."
 (defcustom TeX-insert-macro-default-style 'show-optional-args
   "Specifies whether `TeX-insert-macro' will ask for all optional arguments.
 
-If set to the symbol `show-optional-args', `TeX-insert-macro' asks for
-optional arguments of TeX marcos.  If set to `mandatory-args-only',
+If set to the symbol `show-optional-args', `TeX-insert-macro'
+asks for optional arguments of TeX marcos, unless the previous
+optional argument has been rejected.  If set to
+`show-all-optional-args', `TeX-insert-macro' asks for all
+optional arguments.  If set to `mandatory-args-only',
 `TeX-insert-macro' asks only for mandatory argument.
 
 When `TeX-insert-macro' is called with \\[universal-argument], it's the other
 way round.
 
 Note that for some macros, there are special mechanisms, see e.g.
-`LaTeX-includegraphics-options-alist'."
+`LaTeX-includegraphics-options-alist' and `TeX-arg-cite-note-p'."
   :group 'TeX-macro
   :type '(choice (const mandatory-args-only)
-                (const show-optional-args)))
+                (const show-optional-args)
+                (const show-all-optional-args)))
 
 (defvar TeX-arg-opening-brace nil
   "String used as an opening brace for argument insertion.
@@ -2778,11 +2782,14 @@ See `TeX-parse-macro' for details."
       (if (vectorp (car args))
          ;; Maybe get rid of all optional arguments.  See `TeX-insert-macro'
          ;; for more comments.  See `TeX-insert-macro-default-style'.
-         (unless (or (and (eq TeX-insert-macro-default-style 
'show-optional-args)
-                          (equal current-prefix-arg '(4)))
-                     (and (eq TeX-insert-macro-default-style 
'mandatory-args-only)
-                          (null (equal current-prefix-arg '(4))))
-                     last-optional-rejected)
+         (unless (if (eq TeX-insert-macro-default-style 
'show-all-optional-args)
+                     (equal current-prefix-arg '(4))
+                   (or
+                    (and (eq TeX-insert-macro-default-style 
'show-optional-args)
+                         (equal current-prefix-arg '(4)))
+                    (and (eq TeX-insert-macro-default-style 
'mandatory-args-only)
+                         (null (equal current-prefix-arg '(4))))
+                    last-optional-rejected))
            (let ((TeX-arg-opening-brace LaTeX-optop)
                  (TeX-arg-closing-brace LaTeX-optcl))
              (TeX-parse-argument t (if (equal (length (car args)) 1)



reply via email to

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