auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Redefining the context engine


From: Ralf Angeli
Subject: Re: [AUCTeX] Redefining the context engine
Date: Sun, 05 Dec 2010 18:13:14 +0100

* Vladimir Lomov (2010-11-30) writes:

>>> -------------------------- 8< --------------------------
>>> (eval-after-load "tex"
>>>   '(setq TeX-command-list
>>>     (cons '("ConTeXt" 
>>> "/usr/local/opt/texlive/context/tex/texmf-linux-64/bin/context %s" 
>>> TeX-run-TeX t t :help "Run context (MarkIV)")
>>>       TeX-command-list)))
>>> -------------------------- 8< --------------------------

[...]

> I came to following solution. It works beside 'View':
> -------------------------- 8< --------------------------
> (add-hook 'ConTeXt-mode-hook (lambda ()
>   (setq TeX-PDF-mode t)
>   (setq TeX-command-list
>     (cons '("ConTeXt" 
> "PATH=/usr/local/opt/context/tex/texmf-linux-64/bin:$PATH context %s" 
> TeX-run-command nil t :help "Run context (MarkIV)")
>         TeX-command-list))
>   ))
> -------------------------- 8< --------------------------
>
> If I understand this right then this 1) sets pdf mode for any context file
> 2) sets default command to context (I use context minimal).

Is there a reason that you put it into the mode hook instead of using
`eval-after-load' as in your original code?  As far as I can see there
is no need for the settings to be executed every time the mode is
toggled.  In this regard your new suggestion is worse than the old.

Regarding TeX PDF mode it should suffice to put the setq statement
alone, i.e. without a hook or some such, into your init file.  The
variable is global anyway.  Alternatively you can also use `M-x
customize-variable <RET> TeX-PDF-mode <RET>'.

Regarding the command I'd set PATH correctly in the shell which is used
to start Emacs, then other TeX-related commands called by Emacs will
work as well.

> But there is a problem with 'View': when I start emacs and open a context
> file I see at status line 'ConTeXt-en/P'. If I hit C-c C-c I see
> 'ConTeXt' at bottom, then context compiles document. But next C-c C-c
> shows 'ConTeXt' again. If I toggle pdf mode (off-on) and do C-c C-c
> (compilation), now C-c C-c will show 'View'.

AUCTeX determines if processing ended successfully by looking for the
strings "TeXExec" or "TeXUtil".  It looks like `context' (in contrast to
`texexec') does not emit those and AUCTeX is therefore not able to find
out if processing was successful.  This will have to be fixed in AUCTeX.
That means for the time being you have to select "View" yourself if you
use `context'.

-- 
Ralf



reply via email to

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