[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 6433dc3 30/71: Extend `TeX-read-key-val' to acce
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 6433dc3 30/71: Extend `TeX-read-key-val' to accept a function call |
Date: |
Fri, 17 Dec 2021 15:00:30 -0500 (EST) |
branch: externals/auctex
commit 6433dc38e49ab79a4341ad515d1bf8986be3b9c2
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Extend `TeX-read-key-val' to accept a function call
* doc/changes.texi: Document the change.
* latex.el (TeX-read-key-val): Accept a function call returning an
alist as second argument.
---
doc/changes.texi | 12 ++++++++++++
latex.el | 17 +++++++++++++----
2 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/doc/changes.texi b/doc/changes.texi
index ba5fab2..30166b9 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -40,6 +40,18 @@ uses these functions, use @code{split-string} and
@code{assoc-string}
instead.
@item
+The function @code{TeX-read-key-val} now accepts a function call as second
+argument. This change should help @AUCTeX{} style writers who use
+@code{TeX-arg-key-val} and have to deal with dynamic key-values. Example
+of usage:
+@lisp
+(TeX-add-style-hook "foo"
+ (lambda ()
+ (TeX-add-symbols
+ '("bar" (TeX-arg-key-val (function-returning-key-val))))))
+@end lisp
+
+@item
Since @AUCTeX{} 12.2, @kbd{C-x C-w} accidentally disabled the parse on
save in that buffer, even when you enabled @code{TeX-auto-save} option.
This bug was fixed.
diff --git a/latex.el b/latex.el
index 9630556..afd4190 100644
--- a/latex.el
+++ b/latex.el
@@ -3097,12 +3097,21 @@ 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. Use PROMPT as the prompt string."
+for the key. KEY-VAL-ALIST can be a symbol or a function call
+returning an alist. Use PROMPT as the prompt string."
(multi-prompt-key-value
(TeX-argument-prompt optional prompt "Options (k=v)")
- (if (symbolp key-val-alist)
- (eval key-val-alist t)
- key-val-alist)))
+ (cond ((and (symbolp key-val-alist)
+ (boundp key-val-alist))
+ (symbol-value key-val-alist))
+ ((and (listp key-val-alist)
+ (symbolp (car key-val-alist))
+ (fboundp (car key-val-alist)))
+ (let ((head (car key-val-alist))
+ (tail (cdr key-val-alist)))
+ (apply head tail)))
+ (t
+ key-val-alist))))
(defun TeX-arg-key-val (optional key-val-alist &optional prompt)
"Prompt for keys and values in KEY-VAL-ALIST.
- [elpa] externals/auctex ae2d7ef 23/71: Silence compiler warning, (continued)
- [elpa] externals/auctex ae2d7ef 23/71: Silence compiler warning, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex f6dd4a4 25/71: ; Silence the compiler, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex df0d719 52/71: Improve handling of key=vals in style/hologo.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 08f5c9e 51/71: Improve handling of key=vals in style/floatrow.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 9fa3859 38/71: ; Remove duplicates, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 7b632c6 43/71: * doc/todo.texi (Mid-term Goals): Add TODO about tool bar., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex b379da7 18/71: Don't indent begin/end of comment env, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 483f6e9 05/71: ; * style/hyperref.el ("hyperref"): Fix other link to testform.tex., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 380bc4a 06/71: Handle optional embellishment arguments correctly, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex bd723c7 24/71: Cater for corner case when dealing with TeX error, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 6433dc3 30/71: Extend `TeX-read-key-val' to accept a function call,
Tassilo Horn <=
- [elpa] externals/auctex df69443 26/71: ; Silence the compiler, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 8e0fb65 47/71: Improve handling of key=vals in style/listings.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 0419539 37/71: Improve style/babel.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex d62d8f3 34/71: Update style/fontspec.el to package version 2.7i, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex b9545c8 45/71: Improve handling of key=vals in style/fancyvrb.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 9e97edc 49/71: Fix wrong logic of the previous commit, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 8c50665 62/71: Add new style/unicodefonttable.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 8e13306 66/71: Update style/url.el to package version 3.4, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 25c8d0f 12/71: Add NEWS for two commands available in Texinfo mode, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 2e26d49 61/71: Update style/siunitx.el to package version 3, Tassilo Horn, 2021/12/17