2002-03-03 Stefan Monnier <monnier@cs.yale.edu>
+ * 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.
;; (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 ()