* tex-compilation-parse-errors misses new-style error messages
@ 2007-09-10 4:51 Joe Wells
2007-09-17 7:05 ` Glenn Morris
0 siblings, 1 reply; 2+ messages in thread
From: Joe Wells @ 2007-09-10 4:51 UTC (permalink / raw)
To: bug-gnu-emacs
Many distributed implementations of TeX are based on the Web2c port.
Since Web2c version 7.3.5 released in 2001-11, the main programs like
“tex”, “latex”, etc., have supported FILE:LINE:ERROR style error
messages. In the current versions, this style of error messages is
enabled with the “--file-line-error” command-line option.
To explain the difference, here is an example of an old-style error
message:
-----------------------------------------------------------------
(./test2.tex
[ ... I've omitted parts of the TeX output here ... ]
(/usr/share/texmf-tetex/tex/latex/base/article.cls
[ ... I've omitted more stuff here ... ]
(/usr/share/texmf-tetex/tex/latex/base/size10.clo)) (./test2.aux)
! Too many }'s.
l.14 xyz }
abc def ghi
-----------------------------------------------------------------
Notice how the file name of the error (./test2.tex) needs to be found
from the messages preceding the error message by scanning parentheses.
Here is the corresponding new-style error message obtained when
FILE:LINE:ERROR style error messages are enabled:
-------------------------------
(./test2.tex
[ ... I've omitted parts of the TeX output here ... ]
(/usr/share/texmf-tetex/tex/latex/base/article.cls
[ ... I've omitted more stuff here ... ]
(/usr/share/texmf-tetex/tex/latex/base/size10.clo)) (./test2.aux)
./test2.tex:14: Too many }'s.
l.14 xyz }
abc def ghi
-------------------------------
The tex-compilation-parse-errors function fails to find error messages
if FILE:LINE:ERROR style error messages are enabled. This should be
easy to fix. The regexp
"^! "
in tex-compilation-parse-errors should be replace by a regexp like the
following one:
"^\\(?:[^:\n]+:[[:digit:]]+:\\|!\\) "
This will find both old-style and new-style error messages.
The characters in the character alternative [^:\n] need to match any
characters that might appear in a pathname of a file input by TeX.
An additional change that might be made is to use the file name
matched by my suggested regexp when a new-style error message is seen.
The code in tex-compilation-parse-errors can usually figure out the
file name from the context of the error message, but the name on the
error message line itself is more likely to be accurate. (There is no
need to try to use the line number, as it is repeated on the next line
and tex-compilation-parse-errors already finds it there.)
Note that it would be wrong to “fix” this by switching to using
compilation-error-regexp-alist (and
compilation-error-regexp-alist-alist). The reason is that
tex-compilation-parse-errors has special code for finding the correct
source file and line within the file when a temporary file is being
used by tex-region or tex-buffer. Also, tex-compilation-parse-errors
knows how to find the correct column by looking at the two lines after
the error message.
I hope this report is helpful.
Joe
======================================================================
In GNU Emacs 22.1.1 (i686-pc-linux-gnu, GTK+ Version 2.8.20)
of 2007-06-27 on artemis
Windowing system distributor `The X.Org Foundation', version 11.0.70000000
configured using `configure '--prefix=/home/jbw/local2' '--enable-debug' '--disable-nls' '--with-x-toolkit=gtk' 'CFLAGS=-O0 -g3 -ggdb''
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-09-17 7:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-10 4:51 tex-compilation-parse-errors misses new-style error messages Joe Wells
2007-09-17 7:05 ` Glenn Morris
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).