[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] Redefining the context engine
From: |
Vladimir Lomov |
Subject: |
Re: [AUCTeX] Redefining the context engine |
Date: |
Mon, 6 Dec 2010 19:14:42 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
** Ralf Angeli [2010-12-05 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?
Yes. I don't know lisp :), so I don't how to use eval-after-load.
I have tried the eval-after-load with lambda but that doesn't work.
> As far as I can see there is no need for the settings to be executed
> every time the mode is toggled.
Agree. This was redundant.
> In this regard your new suggestion is worse than the old.
Oh, dear. Seems I went in wrong direction.
> 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>'.
Yes. Now I do that (setq). First time I thought that I need PDF mode only
for context but I use PDF mode most time so this acceptable. But before
I tried to use two consequent eval-after-load (splitted add-hook) but
only second eval-after-load is work. Is this correct?
> 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.
Yes, but I use context minimal AND TeX Live 2010. Both provides context,
texexec, luatex,... I use pdf[la]tex, xe[la]tex, lua[la]tex from TL and
context from context minimal and don't want to mix binaries (I already
tried, two web2c/kpathsea based installation can't be mixed).
>> 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'.
Erh, sorry my fault. Now I set TeX-PDF-mode globally and after
successful run of context the next C-c C-c shows 'View'.
So, now I have (part of my init file)
------------- 8< -------------
(setq TeX-PDF-mode t)
(eval-after-load "context"
'(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< -------------
and all work as expected (by me).
---
WBR, Vladimir Lomov
--
While money can't buy happiness, it certainly lets you choose your own
f orm of misery.