From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#6227: Color isearch regexp submatches differently Date: Wed, 09 Jun 2010 11:36:38 +0300 Organization: JURTA Message-ID: <8739ww1tjp.fsf@mail.jurta.org> References: <87bpca15ja.fsf@mail.jurta.org> <87wruv1ohr.fsf@mail.jurta.org> <877hmvtn9t.fsf@mail.jurta.org> <874ohyppfs.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1276073912 26321 80.91.229.12 (9 Jun 2010 08:58:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Jun 2010 08:58:32 +0000 (UTC) Cc: 6227@debbugs.gnu.org To: Lennart Borgman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 09 10:58:30 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 1OMH7F-0008Hy-Rj for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Jun 2010 10:58:30 +0200 Original-Received: from localhost ([127.0.0.1]:51652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMH7F-0003Nn-3w for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Jun 2010 04:58:29 -0400 Original-Received: from [140.186.70.92] (port=59295 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMH6z-0003Gx-7Q for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2010 04:58:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMH6x-0000ro-Q2 for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2010 04:58:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58770) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMH6x-0000rk-OP for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2010 04:58:11 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OMH4s-0005Fl-J1; Wed, 09 Jun 2010 04:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov 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 08:56: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.127607371320179 (code B ref 6227); Wed, 09 Jun 2010 08:56:02 +0000 Original-Received: (at 6227) by debbugs.gnu.org; 9 Jun 2010 08:55:13 +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 1OMH44-0005FQ-7z for submit@debbugs.gnu.org; Wed, 09 Jun 2010 04:55:12 -0400 Original-Received: from smtp-out1.starman.ee ([85.253.0.3] helo=mx1.starman.ee) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMH42-0005FK-KH for 6227@debbugs.gnu.org; Wed, 09 Jun 2010 04:55:11 -0400 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.33.93.cable.starman.ee [82.131.33.93]) by mx1.starman.ee (Postfix) with ESMTP id A51973F4147; Wed, 9 Jun 2010 11:55:04 +0300 (EEST) In-Reply-To: (Lennart Borgman's message of "Tue, 8 Jun 2010 15:37:50 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 09 Jun 2010 04:56: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:37624 Archived-At: > 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? > and a help window scrolling I think is useful.) Please provide an example of the scrolling bug too. > 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 scratch. 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 (lambda () ;; This code could be added to `isearch-highlight'. (mapc 'delete-overlay isearch-sub-overlays) (setq isearch-sub-overlays nil) (when isearch-regexp (dolist (i '(1 2 3 4)) (when (match-beginning i) (let ((ov (make-overlay (match-beginning i) (match-end i)))) (overlay-put ov 'face (intern-soft (format "isearch-%d" i))) (overlay-put ov 'priority 1002) (push ov isearch-sub-overlays))))))) 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. -- Juri Linkov http://www.jurta.org/emacs/