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: Wed, 9 Jun 2010 11:14:03 +0200 Message-ID: References: <87bpca15ja.fsf@mail.jurta.org> <87wruv1ohr.fsf@mail.jurta.org> <877hmvtn9t.fsf@mail.jurta.org> <874ohyppfs.fsf@mail.jurta.org> <8739ww1tjp.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 1276075796 554 80.91.229.12 (9 Jun 2010 09:29:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Jun 2010 09:29:56 +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 Wed Jun 09 11:29:53 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 1OMHbc-0002SP-FP for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Jun 2010 11:29:52 +0200 Original-Received: from localhost ([127.0.0.1]:43261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMHbb-0001gF-Es for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Jun 2010 05:29:51 -0400 Original-Received: from [140.186.70.92] (port=46871 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMHa5-0001GE-Ja for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2010 05:28:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMHa1-0005th-Aw for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2010 05:28:17 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50718) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMHa1-0005td-8N for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2010 05:28:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OMHNH-0005P0-2L; Wed, 09 Jun 2010 05:15:03 -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: Wed, 09 Jun 2010 09:15:03 +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.127607486820741 (code B ref 6227); Wed, 09 Jun 2010 09:15:03 +0000 Original-Received: (at 6227) by debbugs.gnu.org; 9 Jun 2010 09:14:28 +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 1OMHMi-0005OU-CY for submit@debbugs.gnu.org; Wed, 09 Jun 2010 05:14:28 -0400 Original-Received: from mail-yw0-f196.google.com ([209.85.211.196]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMHMg-0005OP-Mc for 6227@debbugs.gnu.org; Wed, 09 Jun 2010 05:14:27 -0400 Original-Received: by ywh34 with SMTP id 34so5456727ywh.30 for <6227@debbugs.gnu.org>; Wed, 09 Jun 2010 02:14:23 -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=gUiMwKCtZqRacd3rS9C9y9YRO/okopg7Nq4WySD0msw=; b=kv9BkxtZZDIow3TZEvdjy4tZRAgjle3LbThSBIsUXEkQXEmSUojHaw5VOOeDSDR678 ucBNdTsVaA5wQadFD9/W/y4I23Px7iCDS8/DLrGIrBobQ0EXPVGjkPCGVm2dgF8J8nIO 02NCDUxRZQdtHoo+rjkUGBkfCo2VRdcz3a57U= 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=rnsmqfA261F2dH9zEDWLljlKhtfBRadT+LH1Ue15JQ6ZUKz+2i3gyPiLd7rcj6mfP2 ihxYJFB6Xlr5NsqNmLBdsTcfNXohswRQyy3ybqDDFhJHIITRoeMG+f0QG6e7XW3WczGd 7AYoIueOSWRO6X36IonE0WxBhPLjocBrKYBIw= Original-Received: by 10.101.133.9 with SMTP id k9mr18054070ann.43.1276074863250; Wed, 09 Jun 2010 02:14:23 -0700 (PDT) Original-Received: by 10.100.154.15 with HTTP; Wed, 9 Jun 2010 02:14:03 -0700 (PDT) In-Reply-To: <8739ww1tjp.fsf@mail.jurta.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 09 Jun 2010 05:15:03 -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:37627 Archived-At: On Wed, Jun 9, 2010 at 10:36 AM, Juri Linkov wrote: >> Here is a patch for the submatches highlighting. >> (It includes a bug fix for the prompt face too > > What's a bug in the prompt face? There is a variable, minibuffer-prompt-properties, that holds the name of the face to use. I think this should be used for consistency. It makes it much easier for users. >> and a help window scrolling I think is useful.) > > Please provide an example of the scrolling bug too. I am not sure on that one. Maybe I just forgot to remove it when you implemented your way of doing it? >> The current faces does not look very well together so that must be fixed= . > > If current faces does not look well, then maybe we should completely > get rid of using re-builder.el in isearch, its faces and messy functions > like count-subexps, and to write this functionality for isearch from scra= tch. I thought maybe something like count-subexps is needed now with the numbered submatches. > Do you think something more complicated is necessary for this > functionality than the following simple code: > > (defvar isearch-sub-overlays nil) > (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;; This code could be added to `= isearch-highlight'. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(mapc 'delete-overlay isearch-su= b-overlays) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq isearch-sub-overlays nil) > =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(dolist (i '(1 2 3 4)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when (match-begin= ning i) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((ov (= make-overlay (match-beginning i) (match-end i)))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(ove= rlay-put ov 'face (intern-soft (format "isearch-%d" i))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(ove= rlay-put ov 'priority 1002) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pus= h ov isearch-sub-overlays))))))) It does not take care of numbered matches. But, yes, why not guess? I agree, your approach is probably better. But check for more submatches. Maybe upto the value of some variable, say isearch-max-submatch-num. > It relies on new faces `isearch-1', `isearch-2', `isearch-3', `isearch-4'= . > As for face colors, I tried "magenta1", "magenta2", "magenta3", "magenta4= " > for background colors, and they look good. The problem with mixing isearch faces with re-builder dito was the resulting colors from merging. If it works then just use your suggestions. I have rewritten re-builder.el and got rid of its internal. Just need to cleanup a bit. Now it is just a front end to isearch with more editing capabilities, like rx. I think that can be useful. I plan to keep three "regexp source styles" there and maybe rename them a bit: regexp, string (or maybe read) and rx. I think those names are self explanatory. Unfortunately re-builder now uses string/read instead of regexp/string which is more user-level names.