Hi Jürgen (and other auctex users)... On Tue, Jun 18, 2024 at 11:23 (+0200), Jürgen Hanneder via ntg-context wrote:
1. This sounded like a good solution:
Despite the contextgarden wiki page, which says:
;; AUCTeX defaults to mkii; change to iv for iv and lmtx (ConTeXt-Mark-version "IV")
this seemed like a good idea,
I think the contextgarden wiki page is very out of date on that point. I was using auctex 13.x.y and updated to 14.0.4 a while back, and never had to customize (or otherwise set) any variables to use the executable "context", as opposed to the (I assume) Mk II "texexec".
(custom-set-variables '(ConTeXt-Mark-version "lmtx") '(ConTeXt-engine "lmtx"))
but on my system the error just changes:
Running `ConTeXt Full' on `context-test' with ``texexec --engine=lmtx --nonstop context-test.tex'' /usr/bin/texexec: Zeile 2: mtxrun: Kommando nicht gefunden.
auctex apparently stops using the command "context" directly, but via texexec.
Not on my system. Are you by any chance running an "ancient" version of auctex?
2.
Apparently, your Emacs doesn’t use the same PATH as your terminal. The error message is from /bin/sh, I guess you usually run bash, zsh or the like, and that gets its PATH from .bashrc or something like that. Check how Emacs calls that script, and if you can define a PATH.
I tried the method from https://www.emacswiki.org/emacs/ExecPath and set explicitly a path as
(setq exec-path (append exec-path '("-Path as in Bashrc-")))
Does not work.
I've been using emacs for over thirty years, and have managed to never need to explicitly setq exec-path. How are you starting emacs? If you start it from a terminal session, it should inherit the PATH from your shell, which presumably has the directory where your context executable is found. If you are starting emacs by clicking on some window manager (or desktop environment) button / icon / widget / ... (or 'accelerator key') then evidently your window manager doesn't have the same PATH as your shell. Without knowing what window manager / desktop environment you use, and how you are starting emacs, I can't suggest a specific solution. In my opinion, the Right Thing to do is to ensure your window manager is started with the correct PATH. But depending on your system that could be easy or tricky. More pragmatically, if you created a .desktop file to run emacs, and have a line in that file like Exec=emacs you might replace it with Exec=env PATH=<your path> emacs where <your path> is what you have when you echo $PATH from a terminal session.
3.
And the information in AucTeX on how to change that is frankly deficient.
Exactly. It is a little absurd that it should be so difficult to tell auctex anything.
I recently filed an auctex bug report and one of the auctex developers updated the context.el file (to be put in the next release). I was told that none of the auctex developers use ConTeXt (imagine!!) and that they were happy to have some reports from ConTeXt users. But before you consider contacting them, I strongly advise you to upgrade to the newest auctex release.
To the point that I, who am an Emacs user for almost everything, when I write in ConTeXt I prefer to use Vim.
"The horror, the horror." - Marlon Brando On Tue, Jun 18, 2024 at 16:12 (+0200), Jürgen Hanneder via ntg-context wrote:
Here just an inelegant half-solution:
I added the whole program path to the 'TeX-command-list and it works, but this is hardly satisfying. At least it suggests that nothing else is wrong except that emacs 29.3 and auctex 14.0.5 together decide not to find a path, which is in .bashrc and works fine when called from a shell (not from eshell though).
Again, I suspect your window manager is not started with the complete PATH that you have set up in your shell init file(s). If you wish to dig into this further, I'd be happy to try to help you with it. Cheers Jim