[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex 4816092 36/48: Fix possible endle
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [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)
- [AUCTeX-diffs] [elpa] externals/auctex 6112351 12/48: ; * style/geometry.el (LaTeX-geometry-preamble-key-val-options): Add luatex key., (continued)
- [AUCTeX-diffs] [elpa] externals/auctex 6112351 12/48: ; * style/geometry.el (LaTeX-geometry-preamble-key-val-options): Add luatex key., Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex 4afd633 11/48: Update key=val options to geometry package v5.8, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex 3b758bf 06/48: Use `TeX-search-files-by-type' to assist input \includegraphics, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex d5f98ae 32/48: ; Fix typos, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex 59fa964 05/48: Resolve conflict of argument spec between regexp and literal, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex cad042f 31/48: Add note and test about the change involving non-ascii file name, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex 7371b46 07/48: Add support for dvipdfmx to \includegraphics, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex 00f0e0e 13/48: ; * tex.el (TeX-expand-list): Fix docstring (bug#31217)., Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex 68095a3 15/48: Fix previous removal of xemacs compatibility code, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex 59a9e5b 10/48: Correct how `TeX-record-buffer' is used, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex 4816092 36/48: Fix possible endless loop,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex 527bcb2 16/48: ; * doc/auctex.texi (Processor Options): Add note of case in an option., Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex c64a0e1 27/48: Quote %b expansion string for Zathura, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex 0d5c1c0 41/48: ; Fix last commit and push missing Makefile.in., Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex a59c754 35/48: Adjust test for known emacs bug, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex ff08d38 28/48: Fix region compilation with \usepackage[utf8]{inputenc}, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [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
- [AUCTeX-diffs] [elpa] externals/auctex 1a7b2bf 18/48: Adjust coding system for Japanese pTeX engine on w32, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex 03ba1fa 43/48: Add new style/ocg-p.el and style/ocgx.el, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex cff843b 17/48: Remove obsolete option related to Japanese TeX, Tassilo Horn, 2018/09/16
- [AUCTeX-diffs] [elpa] externals/auctex 3741b8c 26/48: Prepare for UTF-8 with BOM, Tassilo Horn, 2018/09/16