unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: emacs-devel@gnu.org
Subject: Re: problem with recent change to grep-regexp-alist
Date: Wed, 10 Aug 2005 07:02:48 +0300	[thread overview]
Message-ID: <87mznqlb4w.fsf@jurta.org> (raw)
In-Reply-To: <742051605080815562794ed49@mail.gmail.com> (Emanuele Giaquinta's message of "Tue, 9 Aug 2005 00:56:57 +0200")

>> One way to resolve them is to match markup escape sequences that new
>> GNU grep puts around file names and line numbers.  You can see them in
>> grep.txt under the title `GNU grep 2.5.1-cvs with default colors'.
>
> I'm aware of them, are you waiting for the 2.5.2 release to add the
> corresponding element to grep-regexp-alist?

I am not sure it's good to recognize rare cases at the cost of the
overhead of processing these additional escape sequences for file
names and line numbers.  But this is possible with

GREP_COLORS='mt=01;31:fn=35:ln=32:bn=:se=:ml=36:cx=37:ne'

and the regexp

    ("^\\(\033\\[35m\\(.+?\\)\033\\[m.*?\033\\[32m\\([0-9]+\\)\033\\[m.*?\033\\[36m\\).*?\
\\(\033\\[01;31m\\(?:\033\\[K\\)?\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)"
     2 3
     ;; Calculate column positions (beg . end) of first grep match on a line
     ((lambda ()
	(setq compilation-error-screen-columns nil)
        (- (match-beginning 4) (match-end 1)))
      .
      (lambda () (- (match-end 5) (match-end 1)
		    (- (match-end 4) (match-beginning 4)))))
     nil 1)

But it still doesn't fontifify grep matches correctly because other
font-lock rules interfere.

-- 
Juri Linkov
http://www.jurta.org/emacs/

  reply	other threads:[~2005-08-10  4:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-06 10:34 problem with recent change to grep-regexp-alist Emanuele Giaquinta
2005-08-06 18:11 ` Juri Linkov
2005-08-06 19:20   ` David Kastrup
2005-08-07 14:25     ` Emanuele Giaquinta
2005-08-08 20:38       ` Juri Linkov
2005-08-08 22:56         ` Emanuele Giaquinta
2005-08-10  4:02           ` Juri Linkov [this message]
2005-08-09 23:57   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mznqlb4w.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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