emacs-devel
[Top][All Lists]
Advanced

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

Re: New tex-bibtex-file in tex-mode.el to take into account TeX-master


From: Reiner Steib
Subject: Re: New tex-bibtex-file in tex-mode.el to take into account TeX-master
Date: Mon, 22 Dec 2008 10:01:06 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux)

On Mon, Dec 22 2008, Francois Fleuret wrote:

> I slightly modified tex-bibtex-file so that it takes into account the
> variable TeX-master. I guess it was a bug not to do so.

As `TeX-master' is an AUCTeX variable, I'm not sure.

>          (tex-append
>           (or (and (boundp 'TeX-master)
>                    (file-name-nondirectory TeX-master))
>               (file-name-nondirectory (buffer-file-name))) ""))
>       (file-dir (or (and (boundp 'TeX-master)
>                            (file-name-directory TeX-master))
>                       (file-name-directory (buffer-file-name)))))

`TeX-master' can have non-string values[1] as well.

There's similar code in `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)))))

Maybe `tex-bibtex-file' and `tex-main-file' could share some code.

Bye, Reiner.

[1]
,----[ (info "(auctex)Multifile") ]
|  -- User Option: TeX-master
|      The master file associated with the current buffer.  If the file
|      being edited is actually included from another file, then you can
|      tell AUCTeX the name of the master file by setting this variable.
|      If there are multiple levels of nesting, specify the top level
|      file.
| 
|      If this variable is `nil', AUCTeX will query you for the name.
| 
|      If the variable is `t', then AUCTeX will assume the file is a
|      master file itself.
| 
|      If the variable is `shared', then AUCTeX will query for the name,
|      but will not change the file.
`----
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




reply via email to

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