monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 9cd7d2957afb36f64678728d55f79b4c711f06cf
Author: Mosè Giordano <[email protected]>
Date: Sat May 18 00:44:35 2013 +0200
Fixes to TeX-arg-index-tag, TeX-arg-cite, TeX-parse-arguments.
* latex.el: Update copyright years, there have been non-trivial
changes in 1998, 2001, 2002.
(TeX-arg-index-tag): Use `TeX-argument-prompt'.
(TeX-arg-cite): Ditto.
* tex.el: Update copyright years, there have been non-trivial
changes in 1995, 1998.
(TeX-parse-arguments): Move skipping of optional
arguments inside loop over all arguments, because optional
arguments may not be the first ones. Remove unused let-bound
variable `skip-opt'.
(TeX-arg-literal): Remove FIXME comment, `optional' is the first
argument passed to all functions by `TeX-parse-argument'.
---
ChangeLog | 16 ++++++++++++++++
latex.el | 17 +++++------------
tex.el | 27 +++++++++++----------------
3 files changed, 32 insertions(+), 28 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 22169e3..c987164 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2013-05-18 Mos� Giordano <[email protected]>
+
+ * latex.el: Update copyright years, there have been non-trivial
+ changes in 1998, 2001, 2002.
+ (TeX-arg-index-tag): Use `TeX-argument-prompt'.
+ (TeX-arg-cite): Ditto.
+
+ * tex.el: Update copyright years, there have been non-trivial
+ changes in 1995, 1998.
+ (TeX-parse-arguments): Move skipping of optional
+ arguments inside loop over all arguments, because optional
+ arguments may not be the first ones. Remove unused let-bound
+ variable `skip-opt'.
+ (TeX-arg-literal): Remove FIXME comment, `optional' is the first
+ argument passed to all functions by `TeX-parse-argument'.
+
2013-05-13 Mos� Giordano <[email protected]>
* style/fancyvrb.el: New style.
diff --git a/latex.el b/latex.el
index c8aa77d..7de3ef4 100644
--- a/latex.el
+++ b/latex.el
@@ -1,7 +1,6 @@
;;; latex.el --- Support for LaTeX documents.
-;; Copyright (C) 1991, 1993-1997, 1999, 2000, 2003-2013
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1993-2013 Free Software Foundation, Inc.
;; Maintainer: [email protected]
;; Keywords: tex
@@ -1586,12 +1585,8 @@ This is the name of an index, not the entry.
If OPTIONAL is non-nil, insert the resulting value as an optional
argument, otherwise as a mandatory one. Use PROMPT as the prompt
string. ARGS is unused."
- (let (tag)
- (setq prompt (concat (if optional "(Optional) " "")
- (if prompt prompt "Index tag")
- ": (default none) "))
- (setq tag (read-string prompt))
- (TeX-argument-insert tag optional)))
+ (TeX-argument-insert
+ (read-string (TeX-argument-prompt optional prompt "Index tag")) optional))
(defun TeX-arg-index (optional &optional prompt &rest args)
"Prompt for an index entry completing with known entries.
@@ -1642,10 +1637,8 @@ the list of defined environments."
If OPTIONAL is non-nil, insert the resulting value as an optional
argument, otherwise as a mandatory one. Use PROMPT as the prompt
string. DEFINITION is unused."
- (setq prompt (concat (if optional "(Optional) " "")
- (if prompt prompt "Add key")
- ": (default none) "))
- (let ((items (multi-prompt "," t prompt (LaTeX-bibitem-list))))
+ (let ((items (multi-prompt "," t (TeX-argument-prompt optional prompt "Key")
+ (LaTeX-bibitem-list))))
(apply 'LaTeX-add-bibitems items)
(TeX-argument-insert (mapconcat 'identity items ",") optional optional)))
diff --git a/tex.el b/tex.el
index cc4257c..a6b0e1b 100644
--- a/tex.el
+++ b/tex.el
@@ -1,7 +1,6 @@
;;; tex.el --- Support for TeX documents.
-;; Copyright (C) 1985-1987, 1991, 1993, 1994, 1996, 1997, 1999-2013
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985-1987, 1991, 1993-2013 Free Software Foundation, Inc.
;; Maintainer: [email protected]
;; Keywords: tex
@@ -2749,20 +2748,16 @@ INITIAL-INPUT is a string to insert before reading
input."
"Parse TeX macro arguments ARGS.
See `TeX-parse-macro' for details."
- (let ((last-optional-rejected nil)
- skip-opt)
- ;; Maybe get rid of all optional arguments. See `TeX-insert-macro' for
- ;; more comments. See `TeX-insert-macro-default-style'.
- (when (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)))))
- (while (vectorp (car args))
- (setq args (cdr args))))
-
+ (let ((last-optional-rejected nil))
(while args
(if (vectorp (car args))
- (unless last-optional-rejected
+ ;; 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)
(let ((TeX-arg-opening-brace LaTeX-optop)
(TeX-arg-closing-brace LaTeX-optcl))
(TeX-parse-argument t (if (equal (length (car args)) 1)
@@ -2894,8 +2889,8 @@ Return the number as car and unit as cdr."
(defun TeX-arg-literal (optional &rest args)
"Insert its arguments ARGS into the buffer.
-Used for specifying extra syntax for a macro."
- ;; FIXME: What is the purpose of OPTIONAL here? -- rs
+Used for specifying extra syntax for a macro. The compatibility
+argument OPTION is ignored."
(apply 'insert args))