From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#6227: Color isearch regexp submatches differently Date: Sun, 23 May 2010 02:51:48 +0200 Message-ID: References: <87bpca15ja.fsf@mail.jurta.org> <87wruv1ohr.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1274576286 30135 80.91.229.12 (23 May 2010 00:58:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 23 May 2010 00:58:06 +0000 (UTC) Cc: 6227@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 23 02:58:05 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OFzVz-0004U0-UH for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 May 2010 02:58:04 +0200 Original-Received: from localhost ([127.0.0.1]:56090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFzVz-0005cW-F4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 May 2010 20:58:03 -0400 Original-Received: from [140.186.70.92] (port=33924 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFzVI-0005CJ-2F for bug-gnu-emacs@gnu.org; Sat, 22 May 2010 20:57:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFzVC-0006ER-SI for bug-gnu-emacs@gnu.org; Sat, 22 May 2010 20:57:19 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37134) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFzVC-0006EM-Da for bug-gnu-emacs@gnu.org; Sat, 22 May 2010 20:57:14 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OFzR8-0001Iu-6C; Sat, 22 May 2010 20:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 May 2010 00:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6227 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6227-submit@debbugs.gnu.org id=B6227.12745759365002 (code B ref 6227); Sun, 23 May 2010 00:53:02 +0000 Original-Received: (at 6227) by debbugs.gnu.org; 23 May 2010 00:52:16 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFzQN-0001Id-7Y for submit@debbugs.gnu.org; Sat, 22 May 2010 20:52:15 -0400 Original-Received: from mail-gw0-f44.google.com ([74.125.83.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFzQK-0001IL-8Q for 6227@debbugs.gnu.org; Sat, 22 May 2010 20:52:12 -0400 Original-Received: by gwj15 with SMTP id 15so155978gwj.3 for <6227@debbugs.gnu.org>; Sat, 22 May 2010 17:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=z9cYEmer8mUnrxyGSXup2ZvgggR+2vuScmqEWR6djMA=; b=nKUr6DYsJrDz1GfsF/5g9fL3kyD1ZRcWF9fADyASaBmw+qB1T51PFIkQS9c3rLcCGz JmSAMmbOD79wgsGdBQxVmrM0s6GlDSqcwp+Tbqn25uX9pUIEG5ItZa/8TeIXRBGse+Gt uvgsQleQpSYyPqOw4In7fYG+BPhpvWIHHe8Vs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=S3gTLgzE+NlIitUFbcchU2XN1CVsdEE6Omfo4OSZaP9IQaG7C5MOwPuP9gUI5X9Zi6 YmLj+XOI983tRDWDT2HYo0CArrejXZVc2SeOL5PbMPyvUbF3SU3O5fAgHV0nKZ5Wws09 5VwKDg4EsYa/gYLe2ROPtlK7maLzOyImindio= Original-Received: by 10.100.26.12 with SMTP id 12mr4162513anz.177.1274575928149; Sat, 22 May 2010 17:52:08 -0700 (PDT) Original-Received: by 10.100.177.20 with HTTP; Sat, 22 May 2010 17:51:48 -0700 (PDT) In-Reply-To: <87wruv1ohr.fsf@mail.jurta.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 22 May 2010 20:53:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37191 Archived-At: On Sun, May 23, 2010 at 1:44 AM, Juri Linkov wrote: >>> We already have highlighting like that: lisp/emacs-lisp/re-builder.el >>> uses faces `reb-match-1', `reb-match-2', `reb-match-3' to highlight >>> regexp subexpressions. =C2=A0I think this should be used by isearch. >> >> That sounds right to me. >> >> Also Drew suggestion to not color submatches in lazy marking seems right= . > > (add-hook 'isearch-update-post-hook > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda () > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(require 're-builder) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when isearch-regexp > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((reb-regexp isearch= -string) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(reb= -target-buffer (current-buffer)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(reb= -target-window (selected-window))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(reb-update-overla= ys))))) > > (add-hook 'isearch-mode-end-hook > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda () > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((reb-target-buffer (curren= t-buffer))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(reb-delete-overlays)))) Nice. So I suggest moving (and renaming) `reb-count-subexps' to isearch.el and splitting off the marking of one overlay from `reb-update-overlays' and moving that too to isearch.el (since isearch.el) is probably always loaded for a normal Emacs user).