unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* new compile.el
@ 2009-03-06 12:48 Reto Zimmermann
  2009-03-06 22:24 ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Reto Zimmermann @ 2009-03-06 12:48 UTC (permalink / raw)
  To: Emacs Devel

How do I transition a major mode (vhdl-mode) to use the new compile.el? 
  From reading the compilation-error-regexp-alist description it sounds 
like it should still work with the old alist but then it doesn't work 
right.  Converting to use compilation-error-regexp-alist-alist is 
problematic because it only seems to accept one regexp per mode, while I 
use several regexps to match error messages of the various VHDL 
compilers that exist.

Any hints at how I can get this to work and all the things that need to 
be changed?

Thanks,
Reto




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: new compile.el
  2009-03-06 12:48 new compile.el Reto Zimmermann
@ 2009-03-06 22:24 ` Stefan Monnier
  2009-03-06 22:41   ` Reto Zimmermann
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2009-03-06 22:24 UTC (permalink / raw)
  To: Reto Zimmermann; +Cc: Emacs Devel

> How do I transition a major mode (vhdl-mode) to use the new compile.el? From
> reading the compilation-error-regexp-alist description it sounds like it
> should still work with the old alist but then it doesn't work right.

It should work.  Give us more details of the problems you encountered.


        Stefan




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: new compile.el
  2009-03-06 22:24 ` Stefan Monnier
@ 2009-03-06 22:41   ` Reto Zimmermann
  2009-03-10  2:26     ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Reto Zimmermann @ 2009-03-06 22:41 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs Devel, Reto Zimmermann

Stefan Monnier wrote:

>>How do I transition a major mode (vhdl-mode) to use the new compile.el? From
>>reading the compilation-error-regexp-alist description it sounds like it
>>should still work with the old alist but then it doesn't work right.
> 
> 
> It should work.  Give us more details of the problems you encountered.

Only error messages with a certain syntax ("<filename>:<linenumber>:") 
are found and highlighted, but not others which should also match 
regexps defined in the alist.  Just as if only one regexp from (the 
middle) of the alist is active.  The same alist highlighted all errors 
with the old compile.el.

Reto





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: new compile.el
  2009-03-06 22:41   ` Reto Zimmermann
@ 2009-03-10  2:26     ` Stefan Monnier
  2009-03-10 13:25       ` Reto Zimmermann
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2009-03-10  2:26 UTC (permalink / raw)
  To: Reto Zimmermann; +Cc: Emacs Devel

>>> How do I transition a major mode (vhdl-mode) to use the new
>>> compile.el? From reading the compilation-error-regexp-alist
>>> description it sounds like it should still work with the old alist
>>> but then it doesn't work right.
>> It should work.  Give us more details of the problems you encountered.
> Only error messages with a certain syntax ("<filename>:<linenumber>:") are
> found and highlighted, but not others which should also match regexps
> defined in the alist.  Just as if only one regexp from (the middle) of the
> alist is active.  The same alist highlighted all errors with the old
> compile.el.

How do you set the alist?  With the new code, the alist is not used
directly, but instead it's "compiled" to a set of font-lock-keywords
rules, so if you change it after "compilation" it won't take effect.


        Stefan




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: new compile.el
  2009-03-10  2:26     ` Stefan Monnier
@ 2009-03-10 13:25       ` Reto Zimmermann
  2009-03-10 14:47         ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Reto Zimmermann @ 2009-03-10 13:25 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs Devel

>>>>How do I transition a major mode (vhdl-mode) to use the new
>>>>compile.el? From reading the compilation-error-regexp-alist
>>>>description it sounds like it should still work with the old alist
>>>>but then it doesn't work right.
>>>
>>>It should work.  Give us more details of the problems you encountered.
>>
>>Only error messages with a certain syntax ("<filename>:<linenumber>:") are
>>found and highlighted, but not others which should also match regexps
>>defined in the alist.  Just as if only one regexp from (the middle) of the
>>alist is active.  The same alist highlighted all errors with the old
>>compile.el.
> 
> 
> How do you set the alist?  With the new code, the alist is not used
> directly, but instead it's "compiled" to a set of font-lock-keywords
> rules, so if you change it after "compilation" it won't take effect.

The alist is assigned before the first time "compile" is called.  So not 
at startup but only when the user calls "compile" for the first time.

Reto





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: new compile.el
  2009-03-10 13:25       ` Reto Zimmermann
@ 2009-03-10 14:47         ` Stefan Monnier
  2009-03-11 13:40           ` Reto Zimmermann
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2009-03-10 14:47 UTC (permalink / raw)
  To: Reto Zimmermann; +Cc: Emacs Devel

>> How do you set the alist?  With the new code, the alist is not used
>> directly, but instead it's "compiled" to a set of font-lock-keywords
>> rules, so if you change it after "compilation" it won't take effect.

> The alist is assigned before the first time "compile" is called.  So not at
> startup but only when the user calls "compile" for the first time.

I'm guessing that you're talking about the error-regexp code that's in
emacs/lisp/progmodes/vhdl-mode.el.  Looking at it, I do not quite
understand what the code is meant to do:
vhdl-compile-use-local-error-regexp sets error-regexp-alist in the
vhdl-mode buffer rather than in the compilaiton buffer.

I.e. please reproduce the problem and then in the compilation buffer,
check the value of compilation-error-regexp-alist (and if it looks
correct, check the value of font-lock-keywords as well: even if you're
not familiar with it, you should be able to recognize some parts,
e.g. the fact that each entry in compilation-error-regexp-alist should
have a corresponding entry in font-lock-keywords).


        Stefan




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: new compile.el
  2009-03-10 14:47         ` Stefan Monnier
@ 2009-03-11 13:40           ` Reto Zimmermann
  2009-03-11 14:46             ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Reto Zimmermann @ 2009-03-11 13:40 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs Devel

> I'm guessing that you're talking about the error-regexp code that's in
> emacs/lisp/progmodes/vhdl-mode.el.  Looking at it, I do not quite
> understand what the code is meant to do:
> vhdl-compile-use-local-error-regexp sets error-regexp-alist in the
> vhdl-mode buffer rather than in the compilaiton buffer.

Looks like that's the problem.  It worked before though.  Now variable 
compilation-file-regexp-alist also doesn't exist anymore, so I guess I 
would have to rewrite the whole compilation section of vhdl-mode.

Reto





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: new compile.el
  2009-03-11 13:40           ` Reto Zimmermann
@ 2009-03-11 14:46             ` Stefan Monnier
  2009-03-13 12:46               ` Reto Zimmermann
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2009-03-11 14:46 UTC (permalink / raw)
  To: Reto Zimmermann, Daniel Pfeiffer; +Cc: Emacs Devel

>> I'm guessing that you're talking about the error-regexp code that's in
>> emacs/lisp/progmodes/vhdl-mode.el.  Looking at it, I do not quite
>> understand what the code is meant to do:
>> vhdl-compile-use-local-error-regexp sets error-regexp-alist in the
>> vhdl-mode buffer rather than in the compilation buffer.
> Looks like that's the problem.  It worked before though.

You mean in Emacs-21, right?  compile.el hasn't been changed much in
Emacs-23, IIRC.

Indeed, I now see that Emacs-21's compile.el explicitly copied the
error-regexp-alist setting from the calling buffer to the
compilation buffer.  I guess it might make sense to do that as well in
the new compile.el.  Daniel, could you look into it?

> Now variable compilation-file-regexp-alist also doesn't exist anymore,
> so I guess I would have to rewrite the whole compilation section of
> vhdl-mode.

IIRC you can just place the corresponding entries onto
compilation-error-regexp-alist.


        Stefan




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: new compile.el
  2009-03-11 14:46             ` Stefan Monnier
@ 2009-03-13 12:46               ` Reto Zimmermann
  0 siblings, 0 replies; 9+ messages in thread
From: Reto Zimmermann @ 2009-03-13 12:46 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Daniel Pfeiffer, Emacs Devel, Reto Zimmermann

Stefan Monnier wrote:

>>>I'm guessing that you're talking about the error-regexp code that's in
>>>emacs/lisp/progmodes/vhdl-mode.el.  Looking at it, I do not quite
>>>understand what the code is meant to do:
>>>vhdl-compile-use-local-error-regexp sets error-regexp-alist in the
>>>vhdl-mode buffer rather than in the compilation buffer.
>>
>>Looks like that's the problem.  It worked before though.
> 
> 
> You mean in Emacs-21, right?  compile.el hasn't been changed much in
> Emacs-23, IIRC.

Yes, in Emacs-21.

>>Now variable compilation-file-regexp-alist also doesn't exist anymore,
>>so I guess I would have to rewrite the whole compilation section of
>>vhdl-mode.
> 
> 
> IIRC you can just place the corresponding entries onto
> compilation-error-regexp-alist.

Will try it, thanks.

Reto





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-03-13 12:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-06 12:48 new compile.el Reto Zimmermann
2009-03-06 22:24 ` Stefan Monnier
2009-03-06 22:41   ` Reto Zimmermann
2009-03-10  2:26     ` Stefan Monnier
2009-03-10 13:25       ` Reto Zimmermann
2009-03-10 14:47         ` Stefan Monnier
2009-03-11 13:40           ` Reto Zimmermann
2009-03-11 14:46             ` Stefan Monnier
2009-03-13 12:46               ` Reto Zimmermann

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).