emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for tex-mode.el (more compatibility with AUCTeX)


From: Markus Rost
Subject: Patch for tex-mode.el (more compatibility with AUCTeX)
Date: Sat, 27 Nov 2004 18:40:38 -0500

Currently tex-mode supports the variable TeX-master (from AUCTeX) if
it is a string.  See lines 1694-1698 in tex-mode.el.  I suggest to
support the variable TeX-master also if it is set to 't.  In that case
the "master" of the file is the file itself, so the right thing is to
run TeX on the buffer's file.  What about the following patch for
tex-mode.el?  Stefan?

I have a bunch of old .tex files which have Local Variable sections
created by AUCTeX.  The patch would make tex-mode handle those files
better.


        * textmodes/tex-mode.el (tex-main-file): Add a compatibility with
        AUCTeX.


===Buffer *vc-diff*=========================================
*** tex-mode.el.~1.150.~        Mon Oct 25 16:35:24 2004
--- tex-mode.el Sat Nov 27 18:20:28 2004
***************
*** 1700,1709 ****
                   (if (not buffer-file-name)
                       (error "Buffer is not associated with any file")
                     (file-relative-name
!                     (if (save-excursion
!                           (goto-char (point-min))
!                           (re-search-forward tex-start-of-header
!                                              (+ (point) 10000) t))
                          ;; This is the main file.
                          buffer-file-name
                        ;; This isn't the main file, let's try to find better,
--- 1700,1713 ----
                   (if (not buffer-file-name)
                       (error "Buffer is not associated with any file")
                     (file-relative-name
!                     (if (or
!                          ;; Compatibility with AUCTeX.
!                          (with-no-warnings
!                           (and (boundp 'TeX-master) (eq TeX-master t)))
!                          (save-excursion
!                            (goto-char (point-min))
!                            (re-search-forward tex-start-of-header
!                                               (+ (point) 10000) t)))
                          ;; This is the main file.
                          buffer-file-name
                        ;; This isn't the main file, let's try to find better,
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]