]> git.eshelyaron.com Git - emacs.git/commitdiff
(tex-guess-main-file): Handle the case where one of the buffers is narrowed.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 4 Mar 2002 01:39:55 +0000 (01:39 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 4 Mar 2002 01:39:55 +0000 (01:39 +0000)
lisp/ChangeLog
lisp/textmodes/tex-mode.el

index 17fae7a7fc96daf203a0bc79a1cb0551866e87ff..79d1b7745c432b90c34b3a356b095f4166af1162 100644 (file)
@@ -1,5 +1,8 @@
 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.
 
index 465cb98c047068ac3dbc2b2bf9666c7f957b215a..43a26cf2296671f7fb30e716183c0f39f82acd71 100644 (file)
@@ -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 ()