help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: binding a command and a parameter


From: Joost Kremers
Subject: Re: binding a command and a parameter
Date: 14 Oct 2007 19:54:55 GMT
User-agent: slrn/0.9.8.1 (Linux)

Nikola Skoric wrote:
> Of course dvi file is up-to-date since I'm editing .tex file which is then
> \included to .tex file I'm compiling (main fail doesn't change). So, my 
> default
> option is always view :-)

then there is something not entirely right about your setup. my first guess
would be that you don't have a TeX-master set in your included files. if
you do, AUCTeX will know that the file you're editing is not the master
file, and will do the right thing if you compile your document. (what i
mean is, you can then type C-c C-c in your included file, the one you're
editing, and AUCTeX will know that it should actually compile the master
file; it will also know that even though the master file hasn't changed, it
must still run LaTeX on in, instead of xdvi.)

the way to do this is to include a block of Local Variables in all of your
latex files, right at the end:

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "thesis"
%%% End: 

the important part is the TeX-master variable. this tells AUCTeX that the
master file is thesis.tex, not chapter1.tex (or whatever file you're
editing).

in the master file itself, TeX-master should just be t:

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 

if you start a new .tex file, AUCTeX normally asks you want the master file
is. if you use multi-file documents, it's a very good idea to set this up
properly.

>> however, the prompt sports TAB-completion, so all you really need to type
>> to get latex is just `l', then hit RETURN.
>
> Arrow up works fine to, but I'd really like to learn how to bind this kind of
> commands. :-D

well, i guess binding a command plus interactive input to a key isn't the
most common thing to do. personally, i'd delve into the AUCTeX source a bit
and find out what lisp invocation actually runs the requisite latex command
on the file i'm editing, wrap it in a lambda form and bind that to a
key. but that requires some knowledge of lisp, of course. a quicker method
may be to use a keyboard macro: (info "(emacs)Keyboard Macros").


-- 
Joost Kremers                                      address@hidden
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


reply via email to

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