emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new style Emacs compile


From: Daniel Pfeiffer
Subject: Re: new style Emacs compile
Date: Thu, 27 Nov 2003 20:54:13 +0100

Salut Stefan,

Stefan Monnier <address@hidden> skribis:

> > This is a reimplementation of error locating in Emacs `compile'.
> > Error locations only became mouse-sensitive rather late, and were often
> > somehow forgotten again.  Or when clicking on one, it would jump to
> > a different file.
> 
> I think it's a good idea to rework compile.el.
> I hope it will make it possible to deal with:
> - error messages that span more than one line
> - error messages that do not start at column 0
> - error messages where the filename is only printed once per file
>   and where nesting may occur.

Until this is ready for switching over I try to stay as compatible as possible 
with the existing compile.el.  This is especially true of the huge 
error-regexp-alist.  When I near completion I will transform that to the new 
data format.  Right now I have only broken the format sublist, which none of 
the standard matchers uses anyways.

This means that, like the old compile did, I still tack ^ to the beginning of 
each regexp.  I will however keep the algorithm clear of this assumption, so 
it'll be easy to change.  Then messages can match anything font-lock is capable 
of.

> The typical example is TeX where error messages can look like:
> 
>   (file1 (file2
>   Some error message about the second file line 30
>      Some sample text from line 30 that includes funny chars like )
>   )
>   Some other error message [this time about the first file because of the
>   close-paren above]
>   )

I's been years since I've used TeX.  I don't know how to recognize a 
file-ending ')'.  Do they always come right after a file-name or at the 
beginning of a new line, singly or several grouped together?

> Also some languages output not just file positions but file ranges
> (e.g. "error between line30-col5 and line45-col10").

> As well as sml-mode (still not bundled with Emacs :-( ) which cleverly [hey!
> I wrote it!] uses hooks in compilation-error-regexp-alist to do correct
> handling of things like "error between line30-col5 and line45-col10" (point
> is moved to one end, mark to the other, and the mark is activated, so if you
> use transient-mark-mode the region is highlighted).

Hey, that's a clever trick!  It shouldn't be hard to generally put that 
functionality into compilation-mode instead of the current brief highlighting 
of a whole line.  Then all message matchers could just configure which match 
index is the from and the to line, likewise for columns.  It would save going 
over the result with a hook and fixing up the text-properties.

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- 
lerne / learn / apprends / läramå    Esperanto:
                              http://lernu.net/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]