Hi again Arash, see below.
On Mon, Feb 9, 2026 at 20:08 (+0100), Arash Esbati wrote: > Jim Diamond <[email protected]> writes: >> Unfortunately, not. > I thought so, but thanks for confirming. >> Did that change do anything for you? > Yes, AUCTeX now says: > ConTeXt: problems after [0] pages How odd. I wasn't seeing that until I modified TeX-ConTeXt-sentinel() where I deleted the line (re-search-forward "fatal error: " nil t) and added the line (re-search-forward "tex error: " nil t) since there is no "fatal error" to be found in my output. Incidentally... just for certainty, are you running ConTeXt LMTX, and a relatively recent version of that? When I run context --version (from the command line) I get mtx-context | ConTeXt Process Management 1.06 mtx-context | mtx-context | main context file: /usr/local/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv mtx-context | current version: 2026.01.07 10:59 mtx-context | main context file: /usr/local/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl mtx-context | current version: 2026.01.07 10:59 >> In my case, it didn't even give me the "... errors ... Use C-c ` to >> display" message. > ConTeXt errors in ‘*foo output*’. Use C-c ` to display. > is still emitted, it comes just before the other message above, but > we're not still there. With your (not ) in that (cond ) I get the message about errors when I compile a document without errors, and vice versa. This is very curious. Does not reversing the logic there give you this message (I get it, anyway): ConTeXt Full errors in ‘*/tmp/ccc-short output*’. Use C-c ` to display. when you compile a document without errors? >> Seeing "Mark IV" in that code did give me one concern... >> I suspect most (if not virtually all) ConTeXt users at now using LMTX. >> I wonder if any differences between MkIV and LMTX are significant for >> AUCTeX. > Yes, you see that ConTeXt support in AUCTeX didn't receive much love > lately. It would be great if Someone™ would start updating that part. I know, if only we could find that Someone™ :-) I have started looking at the code, but I think it will take me a while to understand what is going on. For example, it seems (maybe I'm wrong here) that the plain TeX mode code path is similar to that of LaTeX mode, but ConTeXt seems to wander off path a fair ways. I don't know whether this is a good or a bad thing, vis-a-vis people like me understanding the code well enough to contribute; I don't really want to know or care about LaTeX-specific things (because I don't use LaTeX), but if that is the most straightforward code path, then perhaps understanding it would give some insight as to why ConTeXt is different. Or maybe it isn't as different as I think, but I will have to study more. >> FWIW, I don't follow you there. Isn't there a search for "fatal error" >> exactly when TeX-TeX-sentinel-check returns non-nil? > This is `TeX-ConTeXt-sentinel': > (defun TeX-ConTeXt-sentinel (process name) > "Cleanup TeX output buffer after running ConTeXt." > (cond > ;; Mark IV > ((with-current-buffer TeX-command-buffer > (string= ConTeXt-Mark-version "IV")) > (cond ((TeX-TeX-sentinel-check process name)) > ((re-search-forward "fatal error: " nil t) > (message (concat name ": problems after " > (TeX-current-pages))) > (setq TeX-command-next TeX-command-default)) > (t > (message (concat name ": successfully formatted " > (TeX-current-pages))) > (setq TeX-command-next TeX-command-Show)))) > ... > Running your example gives: > ! Undefined control sequence > tex error > tex error on line 4 in file ./context-test.tex: > `TeX-ConTeXt-sentinel' runs (TeX-TeX-sentinel-check process name) which > sees ! at the beginning of line and returs non-nil (In the case of an error...) (I will take your word for it triggering on a '^!', I haven't got that far yet.) > (`TeX-TeX-sentinel-check' returns nil if it doesn't find an error). So > the search for "fatal error: " isn't run. Or am I missing something? Yes and no? First, since ConTeXt does not (in 2026 anyway) output "fatal error" (AFAICT), there is no point looking for it. So I think one way or the other that line wants to be updated. Second, if TeX-TeX-sentinel-check doesn't find an error, then is it not the case that we *don't* want to search for "fatal error" (or even "tex error") ? >> Further, ConTeXt (apparently) never outputs "fatal error", so >> searching for that doesn't seem fruitful. > This is what I see when I run the example I sent upthread: > --8<---------------cut here---------------start------------->8--- > ! Undefined control sequence > tex error > tex error on line 4 in file ./context-test.tex: <snip> > Do you see something different? No, I see the same thing. In particular, I see "tex error", not "fatal error". > Does ConTeXt have a command-line switch in order to emit usual TeX > errors instead of the above? Maybe that's enough for us? Oh, that would probably be so nice. Recently I've read some stuff that Hans Hagen (the chief ConTeXt wizard) suggested I look at, and also had a number of email conversations with him, and there has been a lot of re-writing of the internals the "TeX" engine. AIUI, ConTeXt Mk II used pdftex, but for Mk IV they went to luatex (or their own mod of that), and now they use their own LuaMetaTeX engine. So I thing the "usual" TeX errors are gone and they aren't coming back. :-) Thanks for looking into this. I'm sure there is a solution there, and it may (I hope) just finding the place for a small change, as opposed to writing lots of new elisp. (I used to write a fair bit of elisp, but that was 20 years ago, and I've gotten rusty, while the elisp world has moved on.) Cheers. Jim _______________________________________________ bug-auctex mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-auctex
