# HG changeset patch # User Stefan Monnier # Date 1015205969 0 # Node ID f8e3c181984818e6fe150fd5441b3ab57f855ace # Parent 72f0c48d5c611c15ef9798a2f61f5755ebec81e6 (tex-guess-main-file): Handle the case where one of the buffers is narrowed. diff -r 72f0c48d5c61 -r f8e3c1819848 lisp/textmodes/tex-mode.el --- 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 ()