help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: compilation-error-regexp-alist syntax problems


From: Roy Smith
Subject: Re: compilation-error-regexp-alist syntax problems
Date: Mon, 02 Feb 2004 16:38:52 -0500
User-agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X)

In article 
<address@hidden>,
 Stefan Monnier <address@hidden> wrote:

> >         (cons '("\\[javac\\] *\(/[^:]+\):\([^:]*\):" 1 2) 
> >         compilation-error-regexp-alist)
>                                 \\(    \\) \\(   \\)
> 
> The regexp is written as a string.  \ is both a string and
> a regexp operator.  When you write \n in a string it is turned into
> linefeed char.  When you write \( it is turned into an open paren
> (i.e. just as if there was no backslash), when you write \\ it is turned
> into a single backslash.  To pass \( to the regexp engine, you have thus to
> write \\ for the backslash and ( or \( for the open-paren.
> 
> When entering a regexp interactively in C-u C-s (for example), it's
> different because it is not written as an elisp string so the quoting is
> unnecessary.
> 
> 
>         Stefan

Hmmm.  That's not working either.  Now I've got this in my .emacs file:

(add-hook 'compilation-mode-hook 'my-compilation-mode-hook t)
(defun my-compilation-mode-hook ()
  (setq compilation-error-regexp-alist
        (cons '("\\[javac\\] *\\(/[^:]+\\):\\([^:]*\\):" 1 2) 
compilation-error-regexp-alist)
        ))

and it's still not finding the right lines.  When I look at the value of 
compilation-error-regexp-alist (C-h v), I get:

Local in buffer *compilation*; global value is
(("\\[javac\\] *\\(/[^:]+\\):\\([^:]*\\):" 1 2)
 [etc]


reply via email to

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