auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

main 21a7addd: Improve last change


From: Ikumi Keita
Subject: main 21a7addd: Improve last change
Date: Wed, 16 Oct 2024 03:13:29 -0400 (EDT)

branch: main
commit 21a7addd192abed013726fc1fee8350b5ee27e74
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>

    Improve last change
    
    * style/graphicx.el (LaTeX-parse-graphicspath): Temporarily remove
    narrowing so that \graphicspath isn't hidden.
---
 style/graphicx.el | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/style/graphicx.el b/style/graphicx.el
index 78cdff95..2d78893f 100644
--- a/style/graphicx.el
+++ b/style/graphicx.el
@@ -179,15 +179,17 @@ Return value is a list of paths."
         (graphicspath-regex "\\\\graphicspath{\\({\\([^}]*\\)}\\)*}")
         (single-path-regex "{\\([^{}]*\\)}"))
     (save-excursion
-      (goto-char (point-min))
-      (while (re-search-forward graphicspath-regex nil t)
-        (let ((start-pos (match-beginning 0))
-              (end-pos (match-end 0)))
-          (save-excursion
-            (goto-char start-pos)
-            (while (re-search-forward single-path-regex end-pos t)
-              (push (match-string-no-properties 1) results)))))
-      (nreverse results))))
+      (save-restriction
+        (widen)
+        (goto-char (point-min))
+        (while (re-search-forward graphicspath-regex nil t)
+          (let ((start-pos (match-beginning 0))
+                (end-pos (match-end 0)))
+            (save-excursion
+              (goto-char start-pos)
+              (while (re-search-forward single-path-regex end-pos t)
+                (push (match-string-no-properties 1) results)))))
+        (nreverse results)))))
 
 (defun LaTeX-includegraphics-read-file-TeX ()
   "Read image file for \\includegraphics.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]