[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 4816092 36/48: Fix possible endless loop
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 4816092 36/48: Fix possible endless loop |
Date: |
Sun, 16 Sep 2018 01:47:26 -0400 (EDT) |
branch: externals/auctex
commit 48160922debb8958a51b47fd30aef6afcf55d709
Author: Ikumi Keita <address@hidden>
Commit: Ikumi Keita <address@hidden>
Fix possible endless loop
* tex.el (TeX-expand-list-builtin): Use symbol `file' for the entry
"%T" so that special treatment for `file' about advancing matching
position in `TeX-command-expand' takes effect.
* tests/tex/command-expansion.el (TeX-command-expand-skip-file-name):
New test.
---
tests/tex/command-expansion.el | 29 +++++++++++++++++++++++++++++
tex.el | 5 ++++-
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/tests/tex/command-expansion.el b/tests/tex/command-expansion.el
index 9215a32..14e425d 100644
--- a/tests/tex/command-expansion.el
+++ b/tests/tex/command-expansion.el
@@ -97,4 +97,33 @@
(TeX-command-expand "%`%(extraopts)%' %T" #'TeX-master-file))
" \"\\foo\" \"\\input\" \\\\detokenize\\{\\ abc.tex\\ \\}")))
+(ert-deftest TeX-command-expand-skip-file-name ()
+ "Check whether file name is not subject to further expansion.
+File names obtained as expansion of \"%t\", \"%s\" and so on should be
+skipped for the following expansion to avoid possible endless loop.
+See <https://lists.gnu.org/r/bug-auctex/2014-08/msg00012.html>."
+ (let ((TeX-master "abc-def")
+ (TeX-expand-list '(("-" (lambda () ":")))))
+ (should (string=
+ (TeX-command-expand "%s" #'TeX-master-file)
+ TeX-master))
+ (should (string=
+ (TeX-command-expand "%t" #'TeX-master-file)
+ (TeX-master-file "tex" t)))
+ (should (string=
+ (TeX-command-expand "%T" #'TeX-master-file)
+ (TeX-master-file "tex" t)))
+ (should (string=
+ (TeX-command-expand "%d" #'TeX-master-file)
+ (TeX-master-file "dvi" t)))
+ (should (string=
+ (TeX-command-expand "%f" #'TeX-master-file)
+ (TeX-master-file "ps" t)))
+ ;; The expander of "%o" does not yet cater for this possible endless
+ ;; loop.
+ ;; (should (string=
+ ;; (TeX-command-expand "%o" #'TeX-master-file)
+ ;; (TeX-master-file "pdf" t)))
+ ))
+
;;; command-expansion.el ends here
diff --git a/tex.el b/tex.el
index 63ae293..68a7942 100644
--- a/tex.el
+++ b/tex.el
@@ -540,7 +540,10 @@ string."
(setq pos (+ pos (length TeX-command-text) 9))
(concat TeX-command-text " \"\\input\""))
"")))
- ("%T" TeX--master-or-region-file-with-extra-quotes t t nil t)
+ ;; The fourth argument of t is actually for wrapper function
+ ;; `TeX--master-or-region-file-with-extra-quotes', temporally set
+ ;; as value of `file' in `TeX-command-expand'.
+ ("%T" file t t nil t)
("%n" TeX-current-line)
("%d" file "dvi" t)
("%f" file "ps" t)
- [elpa] externals/auctex 3b1ffcd 30/48: TL 2018 non-ascii file name fix for preview-latex, (continued)
- [elpa] externals/auctex 3b1ffcd 30/48: TL 2018 non-ascii file name fix for preview-latex, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 0d8f8a2 14/48: Prevent spurious newlines to be added, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 527bcb2 16/48: ; * doc/auctex.texi (Processor Options): Add note of case in an option., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 7371b46 07/48: Add support for dvipdfmx to \includegraphics, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 4afd633 11/48: Update key=val options to geometry package v5.8, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 6a17a52 24/48: ; * doc/changes.texi (News in 12.2): Add news about removed option., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex ff08d38 28/48: Fix region compilation with \usepackage[utf8]{inputenc}, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex cad042f 31/48: Add note and test about the change involving non-ascii file name, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 5ce08ab 33/48: Raise robustness of call of dvipng command, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 3741b8c 26/48: Prepare for UTF-8 with BOM, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 4816092 36/48: Fix possible endless loop,
Tassilo Horn <=
- [elpa] externals/auctex 74c4843 40/48: Add new style/thmtools.el and style/thm-restate.el, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex ff8f183 39/48: ; * style/floatrow.el (LaTeX-floatrow-update-key-val-options): Use `setq' inside the loop., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex e0caf59 25/48: Drop compatibility code for older emacsen in preview-latex, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 1fef01c 45/48: Update style/lettrine.el to package version 2.01, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex cff843b 17/48: Remove obsolete option related to Japanese TeX, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex a59c754 35/48: Adjust test for known emacs bug, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 0d5c1c0 41/48: ; Fix last commit and push missing Makefile.in., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 45747b9 42/48: Add \eqref to RefTeX's reference styles, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex a8ea127 29/48: Accept non-ascii file name in accord with change in TL 2018, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 48325a7 20/48: Update URLs further, Tassilo Horn, 2018/09/16