Apologies for this question, which is probably an auctex problem. I have a new install of everything (LinuX, emacs, texlive) and the latest (?) context (ConTeXt ver: 2024.05.27 18:16 LMTX) installed in a separate directory. Running context from the commandline works fine, so I guess I did not misspell the path, but when running "Context All" from emacs, the error is: ----- Running `ConTeXt' on `context-test' with ``context --once --nonstop context-test.tex'' /bin/sh: Zeile 1: context: Kommando nicht gefunden. TeX Output exited abnormally with code 127 at Mon Jun 17 14:03:03 ------ I don't think the .emacs is at fault, it worked before the reinstall and contains, for instance: (setq-default TeX-master t) (setq TeX-parse-self t) (setq TeX-auto-save t) (setq ConTeXt-Mark-version "IV") Any ideas welcome, Jürgen --- Prof. Dr. Juergen Hanneder Philipps-Universitaet Marburg FG Indologie u. Tibetologie Deutschhausstr.12 35032 Marburg Germany Tel. 0049-6421-28-24930 hanneder@staff.uni-marburg.de
Am 17.06.24 um 14:15 schrieb Jürgen Hanneder via ntg-context:
Apologies for this question, which is probably an auctex problem. I have a new install of everything (LinuX, emacs, texlive) and the latest (?) context (ConTeXt ver: 2024.05.27 18:16 LMTX)
Latest ist today’s, but that’s not the problem.
installed in a separate directory.
Running context from the commandline works fine, so I guess I did not misspell the path, but when running "Context All" from emacs, the error is:
----- Running `ConTeXt' on `context-test' with ``context --once --nonstop context-test.tex'' /bin/sh: Zeile 1: context: Kommando nicht gefunden.
TeX Output exited abnormally with code 127 at Mon Jun 17 14:03:03 ------
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. Hraban
In Emacs, I prefer use pure ConTeXt.
I have attached my Emacs init file. This setup is so satisfying.
You can compile your documents with just C-c c and view them with C-c v.
Also, you don't need to close the PDF after every compile (Evince will
restart the contents after compilation).
In GNOME, you can simply switch between windows using Alt+Tab.
I hope this is helpful!
On Mon, Jun 17, 2024 at 1:36 PM Henning Hraban Ramm
Am 17.06.24 um 14:15 schrieb Jürgen Hanneder via ntg-context:
Apologies for this question, which is probably an auctex problem. I have a new install of everything (LinuX, emacs, texlive) and the latest (?) context (ConTeXt ver: 2024.05.27 18:16 LMTX)
Latest ist today’s, but that’s not the problem.
installed in a separate directory.
Running context from the commandline works fine, so I guess I did not misspell the path, but when running "Context All" from emacs, the error is:
----- Running `ConTeXt' on `context-test' with ``context --once --nonstop context-test.tex'' /bin/sh: Zeile 1: context: Kommando nicht gefunden.
TeX Output exited abnormally with code 127 at Mon Jun 17 14:03:03 ------
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.
Hraban
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
Thank you very much for sharing the configuration needed to compile with ConTeXt from Emacs. The standard AucTeX configuration does not allow to compile with the latest version of LMTX. And the information in AucTeX on how to change that is frankly deficient. To the point that I, who am an Emacs user for almost everything, when I write in ConTeXt I prefer to use Vim. Maybe on the Wiki, someone who knows how to configure AucTeX to work with ConTeX, could share the information. And I also think it would be a good idea to include there the definition and key bindings that Seyal Zavira has shared. El 17/6/24 a las 19:41, seyal zavira escribió:
In Emacs, I prefer use pure ConTeXt. I have attached my Emacs init file. This setup is so satisfying. You can compile your documents with just C-c c and view them with C-c v. Also, you don't need to close the PDF after every compile (Evince will restart the contents after compilation). In GNOME, you can simply switch between windows using Alt+Tab. I hope this is helpful!
On Mon, Jun 17, 2024 at 1:36 PM Henning Hraban Ramm
wrote: Am 17.06.24 um 14:15 schrieb Jürgen Hanneder via ntg-context: > > Apologies for this question, which is probably an auctex problem. I have > a new install of everything > (LinuX, emacs, texlive) and the latest (?) context (ConTeXt ver: > 2024.05.27 18:16 LMTX)
Latest ist today’s, but that’s not the problem.
> installed in > a separate directory. > > Running context from the commandline works fine, so I guess I did not > misspell the path, > but when running "Context All" from emacs, the error is: > > ----- > Running `ConTeXt' on `context-test' with ``context --once --nonstop > context-test.tex'' > /bin/sh: Zeile 1: context: Kommando nicht gefunden. > > TeX Output exited abnormally with code 127 at Mon Jun 17 14:03:03 > ------
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.
Hraban ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl https://urldefense.com/v3/__https://mailman.ntg.nl/mailman3/lists/ntg-contex... webpage : https://www.pragma-ade.nl https://urldefense.com/v3/__https://www.pragma-ade.nl__;!!D9dNQwwGXtA!VVy65b... / https://context.aanhet.net https://urldefense.com/v3/__https://context.aanhet.net__;!!D9dNQwwGXtA!VVy65... (mirror) archive : https://github.com/contextgarden/context https://urldefense.com/v3/__https://github.com/contextgarden/context__;!!D9d... wiki : https://wiki.contextgarden.net https://urldefense.com/v3/__https://wiki.contextgarden.net__;!!D9dNQwwGXtA!V... ___________________________________________________________________________________
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist :ntg-context@ntg.nl /https://urldefense.com/v3/__https://mailman.ntg.nl/mailman3/lists/ntg-contex... webpage :https://urldefense.com/v3/__https://www.pragma-ade.nl__;!!D9dNQwwGXtA!VVy65b... /https://urldefense.com/v3/__https://context.aanhet.net__;!!D9dNQwwGXtA!VVy65... (mirror) archive :https://urldefense.com/v3/__https://github.com/contextgarden/context__;!!D9d... wiki :https://urldefense.com/v3/__https://wiki.contextgarden.net__;!!D9dNQwwGXtA!V... ___________________________________________________________________________________
-- Joaquín Ataz López Departamento de Derecho civil Universidad de Murcia
Hi, You can update the command for ConTeXt as follows: Graphically: M-x customize-variable *↵* TeX-command-list *↵* find the appropriate section for ConTeXt commands and change it with (e.g.) "context --purgeall %t" (see attached image). Apply and save. ----------------------------- Using the init.el you can also create your own commands: (custom-set-variables '(ConTeXt-Mark-version "lmtx") '(ConTeXt-engine "lmtx")) (eval-after-load "context" '(setq TeX-command-list (append '( ("context" "context --purgeall %t" TeX-run-command t :help "Run context (lmtx)") ("luametatex" "context --purgeall %t" TeX-run-command t :help "Run context (lmtx)") ) TeX-command-list ) ) ) I hope this helps. Lizardo R.
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,
(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. 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. 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.
To the point that I, who am an Emacs user for almost everything, when I write in ConTeXt I prefer to use Vim.
I started using emacs in the nineties on a college mainframe, so I am not (yet) ready for vim:) Thanks a lot for your tips, I shall write if and when I find a solution. Jürgen --- Prof. Dr. Juergen Hanneder Philipps-Universitaet Marburg FG Indologie u. Tibetologie Deutschhausstr.12 35032 Marburg Germany Tel. 0049-6421-28-24930 hanneder@staff.uni-marburg.de
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).
Thanks again for the tips,
Jürgen
----- Nachricht von Lizardo Reyna via ntg-context
Hi,
You can update the command for ConTeXt as follows:
Graphically:
M-x customize-variable *↵*
TeX-command-list *↵*
find the appropriate section for ConTeXt commands and change it with (e.g.) "context --purgeall %t" (see attached image).
Apply and save.
-----------------------------
Using the init.el you can also create your own commands:
(custom-set-variables '(ConTeXt-Mark-version "lmtx") '(ConTeXt-engine "lmtx"))
(eval-after-load "context" '(setq TeX-command-list (append '( ("context" "context --purgeall %t" TeX-run-command t :help "Run context (lmtx)") ("luametatex" "context --purgeall %t" TeX-run-command t :help "Run context (lmtx)") ) TeX-command-list ) ) )
I hope this helps.
Lizardo R.
----- Ende der Nachricht von Lizardo Reyna via ntg-context
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
participants (7)
-
hanneder@staff.uni-marburg.de
-
Henning Hraban Ramm
-
Jim
-
Joaquín Ataz López
-
Lizardo Reyna
-
Peter Münster
-
seyal zavira