changeset 43691:f8e3c1819848

(tex-guess-main-file): Handle the case where one of the buffers is narrowed.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 04 Mar 2002 01:39:29 +0000
parents 72f0c48d5c61
children 568974ab1796
files lisp/textmodes/tex-mode.el
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/tex-mode.el	Mon Mar 04 01:13:52 2002 +0000
+++ b/lisp/textmodes/tex-mode.el	Mon Mar 04 01:39:29 2002 +0000
@@ -1410,8 +1410,10 @@
 		     ;; (or (easy-mmode-derived-mode-p 'latex-mode)
 		     ;; 	 (easy-mmode-derived-mode-p 'plain-tex-mode))
 		     (save-excursion
-		       (goto-char (point-min))
-		       (re-search-forward header-re 10000 t)))
+		       (save-restriction
+			 (widen)
+			 (goto-char (point-min))
+			 (re-search-forward header-re 10000 t))))
 	    (throw 'found (expand-file-name buffer-file-name))))))))
 
 (defun tex-main-file ()