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: Re: Incremental search with face-remapping-alist does not always work Date: Sun, 8 Dec 2013 08:39:16 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1134a8666a931704ed0023a2 X-Trace: ger.gmane.org 1386484758 28110 80.91.229.3 (8 Dec 2013 06:39:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Dec 2013 06:39:18 +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:39:24 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 1VpY1T-0002iv-Np for ged-emacs-devel@m.gmane.org; Sun, 08 Dec 2013 07:39:23 +0100 Original-Received: from localhost ([::1]:38500 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpY1T-0006Ww-9L for ged-emacs-devel@m.gmane.org; Sun, 08 Dec 2013 01:39:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpY1P-0006TU-CK for emacs-devel@gnu.org; Sun, 08 Dec 2013 01:39:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VpY1O-0002hy-Bp for emacs-devel@gnu.org; Sun, 08 Dec 2013 01:39:19 -0500 Original-Received: from mail-pd0-x230.google.com ([2607:f8b0:400e:c02::230]:50999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpY1N-0002hu-Ve for emacs-devel@gnu.org; Sun, 08 Dec 2013 01:39:18 -0500 Original-Received: by mail-pd0-f176.google.com with SMTP id w10so3305495pde.7 for ; Sat, 07 Dec 2013 22:39:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=eclYs/NOkbLA5lQXB39b7au0Xcqaf0u4iqxUhGQJvVI=; b=xvYjQpdbXGc1f3JTrUCRSl57vQYrdpwHjwABYZylGs2GUaEqKHVkOa9xDahOe9en3S cRPj9I5ll3wK+nyfO3a3hYI+gmYDYTAUw4a+DteSua6ozzqP8G6CLbaZHCRMhT/MbqVS BsnzLpF2Vf4H/Dwk43Kr18Wd5CNYrsRL8EOZPUHzpkXnyoWLHpzlpq1vuYg+a8bcyTBv nqpw4i7GgDhJKkeWFMs00VN6g2xMK+YUCqGUYNopQ9evvkj8T51hP6nEEDqzrbL/Th96 zv5dgF6X8zJyeM0xinP53ilEbXYW9WAqphNCEINu+Q+AmId3eXf7y3T4HMtVM7oYPFZE EwCQ== X-Received: by 10.66.66.202 with SMTP id h10mr13852726pat.70.1386484756810; Sat, 07 Dec 2013 22:39:16 -0800 (PST) Original-Received: by 10.66.72.166 with HTTP; Sat, 7 Dec 2013 22:39:16 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::230 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:166197 Archived-At: --001a1134a8666a931704ed0023a2 Content-Type: text/plain; charset=UTF-8 Yes. Everything was done lovely. The problem was that in the *Info* mode I should not have put :height on the 'default face, because the lazy-highlight and isearch faces were derived temporarly from it. I debugged a little isearch.el to realize that. No more help needed. 2013/12/8 Alin Soare > > 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) > > --001a1134a8666a931704ed0023a2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yes.

Everything was done lovely.
<= div>
The problem was that in the *Info* mode I should not hav= e put :height on the 'default face, because the=C2=A0lazy-highlight and= isearch faces were derived temporarly from it.

I debugged a little isearch.el to realize that.

No more help needed.



2013/12/8 Alin Soare <a= s1789@gmail.com>

I tried= to configure the faces of isearch-mode, given that for each major mode I d= efined a=C2=A0face-remapping-alist.


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


--001a1134a8666a931704ed0023a2--