branch: main commit 21a7addd192abed013726fc1fee8350b5ee27e74 Author: Ikumi Keita <ik...@ikumi.que.jp> Commit: Ikumi Keita <ik...@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.