From: Stefan Monnier Date: Mon, 4 Mar 2002 01:39:29 +0000 (+0000) Subject: (tex-guess-main-file): Handle the case where one of the buffers is narrowed. X-Git-Tag: ttn-vms-21-2-B4~16350 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cb30255a8355e0c8f3eab3431129f2385121a8bf;p=emacs.git (tex-guess-main-file): Handle the case where one of the buffers is narrowed. --- diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 465cb98c047..43a26cf2296 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1410,8 +1410,10 @@ ALL other buffers." ;; (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 ()