unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to edit compilation-error-regexp-alist in .emacs file?
@ 2002-09-16 17:11 Siegfried Heintze
  2002-09-16 18:18 ` Syver Enstad
  2002-09-16 19:52 ` Kai Großjohann
  0 siblings, 2 replies; 8+ messages in thread
From: Siegfried Heintze @ 2002-09-16 17:11 UTC (permalink / raw)


When I put the following in my .emacs fail, I get an error. This is probably
because the necessary modules have not been loaded yet.

How do I automatically execute these statements after the necessary modules
have been loaded?

(setcar (car compilation-error-regexp-alist) (concat "\\(\\[Error\\]
\\|\\[Fatal Error\\] \\)?"  (caar compilation-error-regexp-alist)))
  (setcdr (car compilation-error-regexp-alist) '(3 4 7))

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

* Re: How to edit compilation-error-regexp-alist in .emacs file?
  2002-09-16 17:11 How to edit compilation-error-regexp-alist in .emacs file? Siegfried Heintze
@ 2002-09-16 18:18 ` Syver Enstad
  2002-09-16 19:52 ` Kai Großjohann
  1 sibling, 0 replies; 8+ messages in thread
From: Syver Enstad @ 2002-09-16 18:18 UTC (permalink / raw)


"Siegfried Heintze" <siegfried@heintze.com> writes:

> When I put the following in my .emacs fail, I get an error. This is
> probably
> 
> because the necessary modules have not been loaded yet.
> 
> How do I automatically execute these statements after the necessary
> modules
> 
> have been loaded?
> 
> (setcar (car compilation-error-regexp-alist) (concat "\\(\\[Error\\]
> \\|\\[Fatal Error\\] \\)?"  (caar compilation-error-regexp-alist)))
>   (setcdr (car compilation-error-regexp-alist) '(3 4 7))

Use a hook?

-- 

Vennlig hilsen 

Syver Enstad

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

* Re: How to edit compilation-error-regexp-alist in .emacs file?
  2002-09-16 17:11 How to edit compilation-error-regexp-alist in .emacs file? Siegfried Heintze
  2002-09-16 18:18 ` Syver Enstad
@ 2002-09-16 19:52 ` Kai Großjohann
  2002-09-23  2:00   ` Siegfried Heintze
  1 sibling, 1 reply; 8+ messages in thread
From: Kai Großjohann @ 2002-09-16 19:52 UTC (permalink / raw)


"Siegfried Heintze" <siegfried@heintze.com> writes:

> When I put the following in my .emacs fail, I get an error. This is probably
> because the necessary modules have not been loaded yet.
>
> How do I automatically execute these statements after the necessary modules
> have been loaded?
>
> (setcar (car compilation-error-regexp-alist) (concat "\\(\\[Error\\]
> \\|\\[Fatal Error\\] \\)?"  (caar compilation-error-regexp-alist)))
>   (setcdr (car compilation-error-regexp-alist) '(3 4 7))

This is better style:

(add-to-list 'compilation-error-regexp-alist
             '("your-regexp-here" 3 4 7))

Before that, you might need (require 'compile), or you need to put the
add-to-list statement in a hook, or in an eval-after-load.  The
require statement is simplest, at the cost of some Emacs startup time.

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

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

* Re: How to edit compilation-error-regexp-alist in .emacs file?
  2002-09-16 19:52 ` Kai Großjohann
@ 2002-09-23  2:00   ` Siegfried Heintze
  2002-09-23 13:06     ` Kai Großjohann
  0 siblings, 1 reply; 8+ messages in thread
From: Siegfried Heintze @ 2002-09-23  2:00 UTC (permalink / raw)


I found an example of eval-after-load in the perl module and tried to modify
it for me.

Why does this not work?
(if (fboundp 'eval-after-load)
    (eval-after-load
     "mode-compile"
     '(progn (setcar (car compilation-error-regexp-alist) (concat
"\\(\\[Error\\] \\|\\[Fatal Error\\] \\)?"  (caar
compilation-error-regexp-alist)))
  (setcdr (car compilation-error-regexp-alist) '(3 4 7))
     (push '("^\\([-_a-zA-Z0-9]+\\.[-_a-zA-Z0-9]+\\)[ \t]*([
\t]*\\([0-9]+\\)[ \t]*,[ \t]*\\([0-9]+\\)[ \t]*)[ \t]*:[
\t]*\\(error\\|fatal error\\|warning\\)[ \t]+\\([^ ]+\\):"  1 2 3)
compilation-error-regexp-alist))  )  )

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

* Re: How to edit compilation-error-regexp-alist in .emacs file?
  2002-09-23  2:00   ` Siegfried Heintze
@ 2002-09-23 13:06     ` Kai Großjohann
  2002-09-27  3:37       ` Siegfried Heintze
  0 siblings, 1 reply; 8+ messages in thread
From: Kai Großjohann @ 2002-09-23 13:06 UTC (permalink / raw)


"Siegfried Heintze" <siegfried@heintze.com> writes:

> I found an example of eval-after-load in the perl module and tried to modify
> it for me.
>
> Why does this not work?

What happens when you use it and what did you expect?  What does C-h
v say about the variable compilation-error-regexp-alist?

Do you really mean mode-compile.el or maybe compile.el?

> (if (fboundp 'eval-after-load)
>     (eval-after-load
>      "mode-compile"
>      '(progn (setcar (car compilation-error-regexp-alist) (concat
> "\\(\\[Error\\] \\|\\[Fatal Error\\] \\)?"  (caar
> compilation-error-regexp-alist)))
>   (setcdr (car compilation-error-regexp-alist) '(3 4 7))
>      (push '("^\\([-_a-zA-Z0-9]+\\.[-_a-zA-Z0-9]+\\)[ \t]*([
> \t]*\\([0-9]+\\)[ \t]*,[ \t]*\\([0-9]+\\)[ \t]*)[ \t]*:[
> \t]*\\(error\\|fatal error\\|warning\\)[ \t]+\\([^ ]+\\):"  1 2 3)
> compilation-error-regexp-alist))  )  )

Why not just add new entries?  Frobbing the first entry seems a bit
strange.

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

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

* Re: How to edit compilation-error-regexp-alist in .emacs file?
  2002-09-23 13:06     ` Kai Großjohann
@ 2002-09-27  3:37       ` Siegfried Heintze
  2002-09-27 11:47         ` Kai Großjohann
  0 siblings, 1 reply; 8+ messages in thread
From: Siegfried Heintze @ 2002-09-27  3:37 UTC (permalink / raw)


Well the setcdr and setcar are kinda ugly but they work. I agree, it would
be more readable to just push new values on. I'll change that in the future.

Anyway, to recognize the error messages produced by the apache xerces-j I
have to open my .emacs file, double click on the progn statement (shown in
the fragment of code I initially posted in this thread), paste it into the
alt-shift-: minibuffer and execute it. Then I can use c-x` to jump to the
errors. Can I automate this process of altering the variable
compilation-error-regexp-alist?

I saw the code in the perl module so I just pasted it into my .emacs and it
is not producing any error messages but it is not working either. My code in
the progn statement seems to work as long as it is not executed directly in
my .emacs file (which apparently tries to execute before the
compilation-error-regexp-alist variable has been created).

I don't want to use the require statement because that would require
compile-mode be loaded at that time and I would like to defer that,
especially if I never use it.

If I try to execute in my .emacs file, it complains that there is no such
variable compilation-error-regexp-alist.

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

* Re: How to edit compilation-error-regexp-alist in .emacs file?
  2002-09-27  3:37       ` Siegfried Heintze
@ 2002-09-27 11:47         ` Kai Großjohann
  2002-09-27 22:55           ` Siegfried Heintze
  0 siblings, 1 reply; 8+ messages in thread
From: Kai Großjohann @ 2002-09-27 11:47 UTC (permalink / raw)


"Siegfried Heintze" <siegfried@heintze.com> writes:

> Well the setcdr and setcar are kinda ugly but they work. I agree, it would
> be more readable to just push new values on. I'll change that in the future.

OK.

> Anyway, to recognize the error messages produced by the apache xerces-j I
> have to open my .emacs file, double click on the progn statement (shown in
> the fragment of code I initially posted in this thread), paste it into the
> alt-shift-: minibuffer and execute it. Then I can use c-x` to jump to the
> errors. Can I automate this process of altering the variable
> compilation-error-regexp-alist?

Yes.

> I saw the code in the perl module so I just pasted it into my .emacs and it
> is not producing any error messages but it is not working either. My code in
> the progn statement seems to work as long as it is not executed directly in
> my .emacs file (which apparently tries to execute before the
> compilation-error-regexp-alist variable has been created).

Yes.

> I don't want to use the require statement because that would require
> compile-mode be loaded at that time and I would like to defer that,
> especially if I never use it.

Well, if you have the choice of making Emacs startup slower by 0.5
secs or of having something that does not work, what do you want to
choose :-)

> If I try to execute in my .emacs file, it complains that there is no such
> variable compilation-error-regexp-alist.

When compilation-error-regexp-alist is defined, look which file it
comes from, with C-h v.  I think it's compile, not mode-compile.
Then specify the right filename in eval-after-load.

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)

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

* Re: How to edit compilation-error-regexp-alist in .emacs file?
  2002-09-27 11:47         ` Kai Großjohann
@ 2002-09-27 22:55           ` Siegfried Heintze
  0 siblings, 0 replies; 8+ messages in thread
From: Siegfried Heintze @ 2002-09-27 22:55 UTC (permalink / raw)


Thanks -- that suggestion works!

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

end of thread, other threads:[~2002-09-27 22:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-16 17:11 How to edit compilation-error-regexp-alist in .emacs file? Siegfried Heintze
2002-09-16 18:18 ` Syver Enstad
2002-09-16 19:52 ` Kai Großjohann
2002-09-23  2:00   ` Siegfried Heintze
2002-09-23 13:06     ` Kai Großjohann
2002-09-27  3:37       ` Siegfried Heintze
2002-09-27 11:47         ` Kai Großjohann
2002-09-27 22:55           ` Siegfried Heintze

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