From 90a518cd741d8cdb20d5d38f8b7a5882054d6475 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 4 Mar 2002 01:39:55 +0000 Subject: [PATCH] (tex-guess-main-file): Handle the case where one of the buffers is narrowed. --- lisp/ChangeLog | 3 +++ lisp/textmodes/tex-mode.el | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 17fae7a7fc9..79d1b7745c4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2002-03-03 Stefan Monnier + * textmodes/tex-mode.el (tex-guess-main-file): Handle the case + where one of the buffers is narrowed. + * newcomment.el (comment-forward): Use forward-comment to skip over whitespace (or comments) even when comment-use-syntax is nil. 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 () -- 2.39.2