monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 85d99d649c46abfcdce35559f7a2078f1ccf4023
Author: Mosè Giordano <[email protected]>
Date: Mon Apr 15 15:59:38 2013 +0200
Add prompt argument to TeX-read-key-val and TeX-arg-key-val.
* latex.el (TeX-read-key-val): Add `prompt' optional argument.
(TeX-arg-key-val): Ditto.
---
ChangeLog | 3 +++
latex.el | 12 ++++++------
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9162654..24534ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2013-04-15 Mos� Giordano <[email protected]>
+ * latex.el (TeX-read-key-val): Add `prompt' optional argument.
+ (TeX-arg-key-val): Ditto.
+
* tex.el (fboundp): Use `crm-separator' as separator in XEmacs
`TeX-completing-read-multiple' implementation.
diff --git a/latex.el b/latex.el
index 41fedc7..5bfb5df 100644
--- a/latex.el
+++ b/latex.el
@@ -2196,27 +2196,27 @@ string."
TeX-left-right-braces)))
(indent-according-to-mode)))))
-(defun TeX-read-key-val (optional key-val-alist)
+(defun TeX-read-key-val (optional key-val-alist &optional prompt)
"Prompt for keys and values in KEY-VAL-ALIST and return them.
If OPTIONAL is non-nil, indicate in the prompt that we are
reading an optional argument. KEY-VAL-ALIST is an alist. The
car of each element should be a string representing a key and the
optional cdr should be a list with strings to be used as values
-for the key."
+for the key. Use PROMPT as the prompt string."
(multi-prompt-key-value
- (TeX-argument-prompt optional "Options (k=v)" nil)
+ (TeX-argument-prompt optional prompt "Options (k=v)")
(if (symbolp key-val-alist)
(eval key-val-alist)
key-val-alist)))
-(defun TeX-arg-key-val (optional key-val-alist)
+(defun TeX-arg-key-val (optional key-val-alist &optional prompt)
"Prompt for keys and values in KEY-VAL-ALIST.
Insert the given value as a TeX macro argument. If OPTIONAL is
non-nil, insert it as an optional argument. KEY-VAL-ALIST is an
alist. The car of each element should be a string representing a
key and the optional cdr should be a list with strings to be used
-as values for the key."
- (let ((options (TeX-read-key-val optional key-val-alist)))
+as values for the key. Use PROMPT as the prompt string."
+ (let ((options (TeX-read-key-val optional key-val-alist prompt)))
(TeX-argument-insert options optional)))