monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 3ac59294abc7ad686e8788e5b2c12f78489240f7
Author: Florent Rougon <[email protected]>
Date: Mon Aug 25 09:02:55 2014 +0200
Bugfix in file name expansion.
* tex-buf.el (TeX-command-expand): Fix possible endless loop in
file name expansion.
Signed-off-by: Tassilo Horn <[email protected]>
---
ChangeLog | 5 +++++
tex-buf.el | 10 ++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4bb50da..01ff6dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-25 Florent Rougon <[email protected]> (tiny change)
+
+ * tex-buf.el (TeX-command-expand): Fix possible endless loop in
+ file name expansion.
+
2014-08-24 Mos� Giordano <[email protected]>
* tests/tex/command-expansion.el: New test file.
diff --git a/tex-buf.el b/tex-buf.el
index ea62e11..a3538ba 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -387,7 +387,7 @@ without further expansion."
(concat (and (stringp TeX-command-pos) TeX-command-pos)
(apply ',file args)
(and (stringp TeX-command-pos) TeX-command-pos)))))
- case-fold-search string expansion arguments)
+ expansion-res case-fold-search string expansion arguments)
(setq list (cons
(list "%%" (lambda nil
(setq pos (1+ pos))
@@ -410,7 +410,13 @@ without further expansion."
(TeX-function-p expansion))
(apply expansion arguments))
((boundp expansion)
- (apply (eval expansion) arguments))
+ (setq expansion-res
+ (apply (eval expansion) arguments))
+ (when (eq expansion 'file)
+ ;; Advance past the file name in order to
+ ;; prevent expanding any substring of it.
+ (setq pos (+ pos (length expansion-res))))
+ expansion-res)
(t
(error "Nonexpansion %s" expansion)))))
(if (stringp string)