summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2002-03-04 01:39:55 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2002-03-04 01:39:55 +0000
commit90a518cd741d8cdb20d5d38f8b7a5882054d6475 (patch)
treeb8e07a160123a72e114e0aafcd3e7c7dc96b8906
parent7fa207b9d7ac00f47eed299986fc85b93a489449 (diff)
downloademacs-90a518cd741d8cdb20d5d38f8b7a5882054d6475.tar.gz
(tex-guess-main-file): Handle the case where one of the buffers is narrowed.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/textmodes/tex-mode.el6
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 <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.
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 ()