* New tex-bibtex-file in tex-mode.el to take into account TeX-master
@ 2008-12-22 0:53 Francois Fleuret
2008-12-22 9:01 ` Reiner Steib
0 siblings, 1 reply; 3+ messages in thread
From: Francois Fleuret @ 2008-12-22 0:53 UTC (permalink / raw)
To: emacs-devel
Dear Emacs developers,
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.
Here it is:
---------------------------- snip snip -------------------------------
(defun tex-bibtex-file ()
"Run BibTeX on the current buffer's file."
(interactive)
(if (tex-shell-running)
(tex-kill-job)
(tex-start-shell))
(let (shell-dirtrack-verbose
(tex-out-file
(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-send-command tex-shell-cd-command file-dir)
(tex-send-command tex-bibtex-command tex-out-file))
(tex-display-shell))
---------------------------- snip snip -------------------------------
Best,
--
Francois Fleuret http://www.idiap.ch/~fleuret
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: New tex-bibtex-file in tex-mode.el to take into account TeX-master
2008-12-22 0:53 New tex-bibtex-file in tex-mode.el to take into account TeX-master Francois Fleuret
@ 2008-12-22 9:01 ` Reiner Steib
2008-12-22 12:16 ` Stefan Monnier
0 siblings, 1 reply; 3+ messages in thread
From: Reiner Steib @ 2008-12-22 9:01 UTC (permalink / raw)
To: Francois Fleuret; +Cc: emacs-devel
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-12-22 12:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-22 0:53 New tex-bibtex-file in tex-mode.el to take into account TeX-master Francois Fleuret
2008-12-22 9:01 ` Reiner Steib
2008-12-22 12:16 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).