emacs-devel
[Top][All Lists]
Advanced

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

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


From: Markus Rost
Subject: Re: Patch for tex-mode.el (more compatibility with AUCTeX)
Date: Mon, 29 Nov 2004 16:08:08 -0500

> From: Richard Stallman <address@hidden>
> CC: address@hidden
> Reply-to: address@hidden
> Date: Mon, 29 Nov 2004 01:11:12 -0500
> X-Scanned-By: MIMEDefang 2.42
> X-Spam-Level: 
> 
> Wouldn't this patch be a more natural way to handle TeX-master = t?

Yes, but your patch may perhaps result in an error if buffer-file-name
is nil.  Below is another version, which is essentially your patch,
except for a test for buffer-file-name being non-nil.  Let me know
whether I should install it.

By the way, one could fix my original problem also by just removing
the handling of TeX-master completely.  Not that I want to suggest
that -- with the new patch things should work well.


===Buffer *vc-diff*=========================================
Index: tex-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/textmodes/tex-mode.el,v
retrieving revision 1.150
diff -c -r1.150 tex-mode.el
*** tex-mode.el 25 Oct 2004 20:35:24 -0000      1.150
--- tex-mode.el 29 Nov 2004 19:38:52 -0000
***************
*** 1693,1701 ****
    (let* ((file (or tex-main-file
                   ;; Compatibility with AUCTeX.
                   (with-no-warnings
!                   (when (and (boundp 'TeX-master) (stringp TeX-master))
!                     (make-local-variable 'tex-main-file)
!                     (setq tex-main-file TeX-master)))
                   ;; Try to guess the main file.
                   (if (not buffer-file-name)
                       (error "Buffer is not associated with any file")
--- 1693,1704 ----
    (let* ((file (or tex-main-file
                   ;; Compatibility with AUCTeX.
                   (with-no-warnings
!                   (when (boundp 'TeX-master)
!                     (cond ((stringp TeX-master)
!                            (make-local-variable 'tex-main-file)
!                            (setq tex-main-file TeX-master))
!                           ((and (eq TeX-master t) buffer-file-name)
!                            (file-relative-name buffer-file-name)))))
                   ;; Try to guess the main file.
                   (if (not buffer-file-name)
                       (error "Buffer is not associated with any file")
============================================================

> 
> *** tex-mode.el       26 Oct 2004 04:21:48 -0400      1.150
> --- tex-mode.el       28 Nov 2004 16:19:05 -0500      
> ***************
> *** 1693,1701 ****
>     (let* ((file (or tex-main-file
>                  ;; Compatibility with AUCTeX.
>                  (with-no-warnings
> !                 (when (and (boundp 'TeX-master) (stringp TeX-master))
> !                   (make-local-variable 'tex-main-file)
> !                   (setq tex-main-file TeX-master)))
>                  ;; Try to guess the main file.
>                  (if (not buffer-file-name)
>                      (error "Buffer is not associated with any file")
> --- 1693,1705 ----
>     (let* ((file (or tex-main-file
>                  ;; Compatibility with AUCTeX.
>                  (with-no-warnings
> !                 (when (boundp 'TeX-master)
> !                   (if (stringp TeX-master)
> !                       (progn
> !                         (make-local-variable 'tex-main-file)
> !                         (setq tex-main-file TeX-master))
> !                     (when (eq TeX-master t)
> !                       (file-relative-name buffer-file-name)))))
>                  ;; Try to guess the main file.
>                  (if (not buffer-file-name)
>                      (error "Buffer is not associated with any file")
> 




reply via email to

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