[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 72/299: * latex.el (TeX-read-key-val): New function. (TeX-arg-key
From: |
Stefan Monnier |
Subject: |
[elpa] 72/299: * latex.el (TeX-read-key-val): New function. (TeX-arg-key-val): Use `TeX-read-key-val'. |
Date: |
Sun, 02 Nov 2014 03:10:24 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 8e56a38e1b7c15bfcd6074237ce544023f5c20da
Author: Tassilo Horn <address@hidden>
Date: Thu Mar 7 09:21:40 2013 +0000
* latex.el (TeX-read-key-val): New function.
(TeX-arg-key-val): Use `TeX-read-key-val'.
* style/hyperref.el (LaTeX-hyperref-package-options): Use
`TeX-read-key-val' instead of `TeX-arg-key-val' which caused args
to be inserted twice.
* style/siunitx.el (LaTeX-siunitx-package-options): Ditto.
---
ChangeLog | 11 +++++++++++
latex.el | 19 ++++++++++++++-----
style/hyperref.el | 8 +++-----
style/siunitx.el | 4 +---
4 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e9be8ea..d1186eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-03-07 Tassilo Horn <address@hidden>
+
+ * latex.el (TeX-read-key-val): New function.
+ (TeX-arg-key-val): Use `TeX-read-key-val'.
+
+ * style/hyperref.el (LaTeX-hyperref-package-options): Use
+ `TeX-read-key-val' instead of `TeX-arg-key-val' which caused args
+ to be inserted twice.
+
+ * style/siunitx.el (LaTeX-siunitx-package-options): Ditto.
+
2013-03-06 Mads Jensen <address@hidden>
* style/amsopn.el: Add GPL copyright notice.
diff --git a/latex.el b/latex.el
index ad19ef3..961e921 100644
--- a/latex.el
+++ b/latex.el
@@ -2121,6 +2121,19 @@ string."
TeX-left-right-braces)))
(indent-according-to-mode)))))
+(defun TeX-read-key-val (optional key-val-alist)
+ "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."
+ (multi-prompt-key-value
+ (TeX-argument-prompt optional "Options (k=v)" nil)
+ (if (symbolp key-val-alist)
+ (eval key-val-alist)
+ key-val-alist)))
+
(defun TeX-arg-key-val (optional key-val-alist)
"Prompt for keys and values in KEY-VAL-ALIST.
Insert the given value as a TeX macro argument. If OPTIONAL is
@@ -2128,11 +2141,7 @@ 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 (multi-prompt-key-value
- (TeX-argument-prompt optional "Options (k=v)" nil)
- (if (symbolp key-val-alist)
- (eval key-val-alist)
- key-val-alist))))
+ (let ((options (TeX-read-key-val optional key-val-alist)))
(TeX-argument-insert options optional)))
diff --git a/style/hyperref.el b/style/hyperref.el
index e533dad..f5e708b 100644
--- a/style/hyperref.el
+++ b/style/hyperref.el
@@ -228,10 +228,8 @@
(when (fboundp 'reftex-ref-style-activate)
(reftex-ref-style-activate "Hyperref"))))
-(defun LaTeX-hyperref-package-options nil
- "Prompt for package options for the hyperref package."
- (let ((options
- (TeX-arg-key-val nil LaTeX-hyperref-package-options)))
- options))
+(defun LaTeX-hyperref-package-options ()
+ "Read the hyperref package options from the user."
+ (TeX-read-key-val t LaTeX-hyperref-package-options))
;;; hyperref.el ends here
diff --git a/style/siunitx.el b/style/siunitx.el
index 2e3988c..80acc1b 100644
--- a/style/siunitx.el
+++ b/style/siunitx.el
@@ -597,8 +597,6 @@ string."
(defun LaTeX-siunitx-package-options nil
"Prompt for package options for the siunitx package."
- (let ((options
- (TeX-arg-key-val nil LaTeX-siunitx-package-options)))
- options))
+ (TeX-read-key-val t LaTeX-siunitx-package-options))
;; siunitx.el ends here
- [elpa] 67/299: * tex.el (TeX-run-style-hooks): Guard running style hooks in a `condition-case' in order not to error in cases the auto file contains calls to functions that are defined by a style that has been deactivated in the meantime., (continued)
- [elpa] 67/299: * tex.el (TeX-run-style-hooks): Guard running style hooks in a `condition-case' in order not to error in cases the auto file contains calls to functions that are defined by a style that has been deactivated in the meantime., Stefan Monnier, 2014/11/01
- [elpa] 59/299: * tex.el (require): Require crm., Stefan Monnier, 2014/11/01
- [elpa] 68/299: * latex.el (TeX-arg-date): New function. (LaTeX-common-initialization): Use `TeX-arg-date' for \date macro., Stefan Monnier, 2014/11/01
- [elpa] 57/299: * style/siunitx.el (LaTeX-siunitx-package-options): New function., Stefan Monnier, 2014/11/01
- [elpa] 70/299: * tex.el (TeX-command-list): Add support for xindy., Stefan Monnier, 2014/11/01
- [elpa] 69/299: * latex.el (LaTeX-common-initialization): Added regular expression for thispagestyle and pagestyle to `TeX-complete-list'., Stefan Monnier, 2014/11/01
- [elpa] 66/299: * style/dinbrief.el ("dinbrief"): Update dinbrief style. (LaTeX-dinbrief-insert): New macro. (LaTeX-dinbrief-style): New function. (LaTeX-dinbrief-env-recipient): Rename from `LaTeX-recipient-hook'. (LaTeX-dinbrief-sender): New function. (LaTeX-dinbrief-recipient): New function. (LaTeX-dinbrief-today): Rename from `LaTeX-today'., Stefan Monnier, 2014/11/01
- [elpa] 62/299: * style/kpfonts.el: New style file., Stefan Monnier, 2014/11/01
- [elpa] 71/299: * style/amsopn.el: Add GPL copyright notice. ("amsopn"): Add regex for \DeclareMathOperator to `LaTeX-auto-regexp-list'. Use `TeX-arg-define-macro' for \DeclareMathOperator., Stefan Monnier, 2014/11/01
- [elpa] 73/299: * tex.el (TeX-add-local-master): Remove trailing spaces from inserted lines., Stefan Monnier, 2014/11/01
- [elpa] 72/299: * latex.el (TeX-read-key-val): New function. (TeX-arg-key-val): Use `TeX-read-key-val'.,
Stefan Monnier <=
- [elpa] 76/299: * style/biblatex.el (LaTeX-biblatex-package-options): Correct name of `TeX-read-key-val' argument., Stefan Monnier, 2014/11/01
- [elpa] 75/299: * latex.el (LaTeX-common-initialization): Remove `addbibresource' macro., Stefan Monnier, 2014/11/01
- [elpa] 74/299: * style/biblatex.el (LaTeX-biblatex-addbibresource-options): New variable. (LaTeX-arg-addbibresource): New function, based on current `TeX-arg-bibliography'. ("biblatex"): Add `addbibresource' macro. (LaTeX-biblatex-package-options): Use `TeX-read-key-val'. * latex.el (TeX-arg-bibliography): Remove `addbibresource' support., Stefan Monnier, 2014/11/01
- [elpa] 77/299: * latex.el (TeX-arg-document): Search for LaTeX classes., Stefan Monnier, 2014/11/01
- [elpa] 80/299: Fix for conversion to git., Stefan Monnier, 2014/11/01
- [elpa] 79/299: Minor fix for the latest commit., Stefan Monnier, 2014/11/01
- [elpa] 81/299: Add .gitignore file., Stefan Monnier, 2014/11/01
- [elpa] 85/299: Minor docfix., Stefan Monnier, 2014/11/01
- [elpa] 83/299: provide completion for options in `TeX-arg-document', Stefan Monnier, 2014/11/01
- [elpa] 84/299: improve completion in LaTeX-arg-usepackage, Stefan Monnier, 2014/11/01