From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Roy Smith Newsgroups: gmane.emacs.help Subject: Re: compilation-error-regexp-alist syntax problems Date: Mon, 02 Feb 2004 16:38:52 -0500 Organization: PANIX Public Access Internet and UNIX, NYC Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1075768726 22689 80.91.224.253 (3 Feb 2004 00:38:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 3 Feb 2004 00:38:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 03 01:38:30 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AnoaD-0000ml-00 for ; Tue, 03 Feb 2004 01:38:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AnoVa-0000y7-1O for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Feb 2004 19:33:42 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!priapus.visi.com!orange.octanews.net!news-out.visi.com!petbe.visi.com!news.octanews.net!dimensional.com!pulsar.dimensional.com!news.misty.com!news.pir.net!panix!roy Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-NNTP-Posting-Host: p67-13.acedsl.com Original-X-Trace: reader2.panix.com 1075757932 28256 66.114.67.13 (2 Feb 2004 21:38:52 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Mon, 2 Feb 2004 21:38:52 +0000 (UTC) User-Agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X) Original-Xref: shelby.stanford.edu gnu.emacs.help:120646 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:16594 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16594 In article , Stefan Monnier 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]