From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Newsgroups: gmane.emacs.help Subject: Re: matching different line number format in grep-mode Date: Wed, 27 Jun 2012 13:41:38 +0200 Message-ID: References: <05f99423-1d91-42f7-94a3-ab34fce3a2fd@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1340797319 19021 80.91.229.3 (27 Jun 2012 11:41:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Jun 2012 11:41:59 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Jim Newton Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 27 13:41:58 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SjqdB-0003lw-P5 for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jun 2012 13:41:57 +0200 Original-Received: from localhost ([::1]:58581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjqdB-0002qp-Lw for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jun 2012 07:41:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sjqd2-0002pq-Pj for help-gnu-emacs@gnu.org; Wed, 27 Jun 2012 07:41:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sjqcv-0006Xz-QY for help-gnu-emacs@gnu.org; Wed, 27 Jun 2012 07:41:48 -0400 Original-Received: from mail-ob0-f169.google.com ([209.85.214.169]:48703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sjqcv-0006X2-JS for help-gnu-emacs@gnu.org; Wed, 27 Jun 2012 07:41:41 -0400 Original-Received: by obhx4 with SMTP id x4so1697240obh.0 for ; Wed, 27 Jun 2012 04:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=B9Kt96aKxKcUR5+pE4+974AI6nMiDC6rnbTQwGrmszE=; b=KeTBQgwS1tt7nV26aHkgG2YLJQ3UHMUdnsqJMxzp3KQscXUhecwM4JBi6FjxQS/+Pg ozCKcY33cJBrdIRw9QUILMcc4P9OFVWSKW7m1FDZtYRBSpEtoeOsKhiqQTl1hO+13eJE oWlKH32da0g5AcI/jYQPqh6xIuAYsNY74RqNy0BOOGEak2U1Yc8Hxw0eI/qGHUKUfRbi cLkTF9xCyxNcB1xMKoZIJTH2N30DmriIK1iBLm9Dc45k24Ttz94sXv2jId46z/vdREte fAz30Ycde7mH8RRs/CtSEZbak83O8PE/oze3CAxCLBWx35NN0XW2AtIrTiiNc3DxghKh ugcg== Original-Received: by 10.60.14.68 with SMTP id n4mr19981722oec.24.1340797298715; Wed, 27 Jun 2012 04:41:38 -0700 (PDT) Original-Received: by 10.182.241.7 with HTTP; Wed, 27 Jun 2012 04:41:38 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: BSCSrYrsGGZ5iAgM7yAYZJt7T5A X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85509 Archived-At: On Wed, Jun 27, 2012 at 10:31 AM, Jim Newton wrote: > can you show me how to do this with define-compilation-mode? I don't know what define-compilation-mode is, but why can't you use the compilation-mode and the compilation-error-regexp-alist variable? Eval this in your scratch buffer (select everything and run M-x eval-region): (require 'compile) (add-to-list 'compilation-error-regexp-alist '("^at line \\([0-9]+\\) in file \\(.+\\)$" 2 1)) I've used this as a test (it works): M-x compile RET echo at line 42 in file /foo/bar RET To make it permanent you can add this to your .emacs: (eval-after-load "compile" '(add-to-list 'compilation-error-regexp-alist '("^at line \\([0-9]+\\) in file \\(.+\\)$" 2 1))) You have to use eval-after-load in your .emacs because the variable compilation-...-alist is defined only once compile.el is loaded. And it is automatically loaded when you call M-x compile or any autoloaded function in compile.el (the ones with the ;;;###autoload cookie above). Alternatively you could just copy what you've pasted in *scratch* in your .emacs but it load compile.el every time you start emacs i.e. it will slightly slowdown your emacs startup time. I'm sorry if all of this is obvious to you.