From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Newsgroups: gmane.emacs.devel Subject: GREP_OPTIONS again Date: Fri, 17 Sep 2004 00:51:09 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1095396717 25280 80.91.229.6 (17 Sep 2004 04:51:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Sep 2004 04:51:57 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 17 06:51:44 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C8Aim-0003Zo-00 for ; Fri, 17 Sep 2004 06:51:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C8AoU-0005l3-Dh for ged-emacs-devel@m.gmane.org; Fri, 17 Sep 2004 00:57:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C8AoO-0005ky-FB for emacs-devel@gnu.org; Fri, 17 Sep 2004 00:57:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C8AoN-0005km-Pr for emacs-devel@gnu.org; Fri, 17 Sep 2004 00:57:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C8AoN-0005kj-Nz for emacs-devel@gnu.org; Fri, 17 Sep 2004 00:57:31 -0400 Original-Received: from [206.47.199.163] (helo=simmts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C8AiE-0002sv-TE for emacs-devel@gnu.org; Fri, 17 Sep 2004 00:51:11 -0400 Original-Received: from empanada.home ([67.68.218.144]) by simmts5-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20040917044909.HNQA1635.simmts5-srv.bellnexxia.net@empanada.home>; Fri, 17 Sep 2004 00:49:09 -0400 Original-Received: by empanada.home (Postfix, from userid 502) id 07E2B2EF608; Fri, 17 Sep 2004 00:51:09 -0400 (EDT) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (darwin) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27180 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27180 I just bumped into a bad side-effect of the GREP_OPTIONS thingy: I grepped for MM and then isearched for `MM (', knowing full well there had to be a match but it didn't find anything. The problem was the invisible annotations added by grep because of the --color. I guess we should just remove them rather than make them invisible. The patch below is actually untested (for some reason my grep doesn't want to add those annotations any more right now), Stefan --- orig/lisp/progmodes/grep.el +++ mod/lisp/progmodes/grep.el @@ -1,7 +1,7 @@ ;;; grep.el --- run compiler as inferior of Emacs, parse error messages -;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 1999, 2001, 02, 2004 -;; Free Software Foundation, Inc. +;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +;; 2001, 2002, 2004 Free Software Foundation, Inc. ;; Author: Roland McGrath ;; Maintainer: FSF @@ -258,15 +258,17 @@ . (lambda () (- (match-end 5) (match-end 3) 8))) nil nil - (4 (list 'face nil 'invisible t 'intangible t)) - (5 (list 'face compilation-column-face)) - (6 (list 'face nil 'invisible t 'intangible t)) + ;; Delete annotations with `replace-match' because it updates + ;; the match-data, whereas `delete-region' would render it obsolete. + (5 (progn (replace-match "" t t nil 6) + (replace-match "" t t nil 4) + (list 'face font-lock-function-name-face))) ;; highlight other matches on the same line ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" nil nil - (1 (list 'face nil 'invisible t 'intangible t)) - (2 (list 'face compilation-column-face) t) - (3 (list 'face nil 'invisible t 'intangible t)))) + (2 (progn (replace-match "" t t nil 3) + (replace-match "" t t nil 1) + (list 'face font-lock-function-name-face))))) ("^Binary file \\(.+\\) matches$" 1 nil nil 1)) "Regexp used to match grep hits. See `compilation-error-regexp-alist'.")