From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alin Soare Newsgroups: gmane.emacs.devel Subject: Incremental search with face-remapping-alist does not always work Date: Sun, 8 Dec 2013 08:19:43 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b6d93a677527804ecffdd11 X-Trace: ger.gmane.org 1386483583 18867 80.91.229.3 (8 Dec 2013 06:19:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Dec 2013 06:19:43 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 08 07:19:49 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VpXiX-0002QY-4Z for ged-emacs-devel@m.gmane.org; Sun, 08 Dec 2013 07:19:49 +0100 Original-Received: from localhost ([::1]:38441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpXiW-0003d4-IZ for ged-emacs-devel@m.gmane.org; Sun, 08 Dec 2013 01:19:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpXiT-0003bs-Ku for emacs-devel@gnu.org; Sun, 08 Dec 2013 01:19:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VpXiS-0005xR-OL for emacs-devel@gnu.org; Sun, 08 Dec 2013 01:19:45 -0500 Original-Received: from mail-pb0-x236.google.com ([2607:f8b0:400e:c01::236]:57482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpXiS-0005xL-Gw for emacs-devel@gnu.org; Sun, 08 Dec 2013 01:19:44 -0500 Original-Received: by mail-pb0-f54.google.com with SMTP id un15so3468065pbc.27 for ; Sat, 07 Dec 2013 22:19:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=IrmgfRZu7vgPRzb6A17a8xuMRz6NnQ/iKc8cY3JvLtU=; b=uPrqwJ55McfMYgOj4qIEa8eAph1NwOvP1683B5arCm31uw2r/4nL5xnSKxKa0T+479 vsLmZ9aO/E8kkr3P3jbmoivFuAbpoZNq/LCSk06XnxiULPNcHUa2xnoKmQDohH4ALiYB jPMG63WUzmOAG8sG6Pvg1s/lmnDaaRtxwBDzZfdHJCuqTFXwQ/UswDqH13M43ruUm3Ju S4U2QAJIGVQGbFLfcyQLWcRGMea/mt1btnnaHXVE5u7Peis5JcJvB5iL3twhK0zW807E pFgydpX0jzZmnWBBaBHddxfQf/YlfGFsHbVgE2up1WFFWxA4zCCJVUme0QHdViLybJEm fGGA== X-Received: by 10.68.99.162 with SMTP id er2mr13836477pbb.10.1386483583239; Sat, 07 Dec 2013 22:19:43 -0800 (PST) Original-Received: by 10.66.72.166 with HTTP; Sat, 7 Dec 2013 22:19:43 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:166196 Archived-At: --047d7b6d93a677527804ecffdd11 Content-Type: text/plain; charset=UTF-8 I tried to configure the faces of isearch-mode, given that for each major mode I defined a face-remapping-alist. Here is my problem: 1. take the code below. 2. After evaluation, isearch seems to work nice. 3. Goto into the *Info* buffer. 4. Search the string from the title. (a string from a positon with Info-title-1 face) 5. PROBLEM: the string of the title will get very small, and will change the font. 6. QUESTION: How can this be avoided, and the expected behaviour be accomplished ? (defun isearch-setup () (setq-local lazy-highlight-face (face-remap-add-relative 'lazy-highlight '(:foreground "red") 'default)) (setq-local isearch-face (face-remap-add-relative 'isearch '(:strike-through "white") 'default)) ) (defun isearch-exit () (face-remap-remove-relative lazy-highlight-face) (face-remap-remove-relative isearch-face) (with-current-buffer (get-buffer " *Echo Area 0*") (face-remap-remove-relative echo-area-isearch-fail-face) ) (with-current-buffer (get-buffer " *Echo Area 1*") (face-remap-remove-relative echo-area-isearch-fail-face) ) ) (add-hook 'isearch-mode-hook 'isearch-setup) (add-hook 'isearch-mode-end-hook 'isearch-exit) --047d7b6d93a677527804ecffdd11 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

I tried to configure the faces of isea= rch-mode, given that for each major mode I defined a=C2=A0face-remapping-al= ist.


Here is my problem:
=
1. take the code below.

2. After evalua= tion, isearch seems to work nice.

3. Goto into the= *Info* buffer.

4. Search the string from the titl= e. (a string from a positon with Info-title-1 face)

5. PROBLEM: the string of the title will get very small= , and will change the font.

6. QUESTION: How can t= his be avoided, and the expected behaviour be accomplished ?



(defun isearch-setup ()
<= div>=C2=A0 (setq-local
=C2=A0 =C2=A0lazy-highlight-face
=C2=A0 =C2=A0(face-remap-add-relative 'lazy-highlight =C2=A0'(:for= eground "red") 'default))
=C2=A0 (setq-local
=C2=A0 =C2=A0isearch-face
=C2= =A0 =C2=A0(face-remap-add-relative 'isearch =C2=A0'(:strike-through= "white") 'default))
=C2=A0 )

<= div>(defun isearch-exit ()
=C2=A0 (face-remap-remove-relative lazy-highlight-face)
=C2=A0 (f= ace-remap-remove-relative isearch-face)
=C2=A0 (with-current-buff= er (get-buffer " *Echo Area 0*")
=C2=A0 =C2=A0 (face-re= map-remove-relative echo-area-isearch-fail-face)
=C2=A0 =C2=A0 )
=C2=A0 (with-current-buffer (get-buffer &quo= t; *Echo Area 1*")
=C2=A0 =C2=A0 (face-remap-remove-relative= echo-area-isearch-fail-face)
=C2=A0 =C2=A0 )
=C2=A0 )<= /div>

(add-hook 'isearch-mode-hook 'isearch-setu= p)

(add-hook 'isearch-mode-end-hook 'isearch-exit)=

--047d7b6d93a677527804ecffdd11--