From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: ASCII-folded search [was: Re: Upcoming loss of usability ...] Date: Wed, 24 Jun 2015 01:49:32 +0300 Organization: LINKOV.NET Message-ID: <87k2uudoqr.fsf@mail.linkov.net> References: <20150615142237.GA3517@acm.fritz.box> <87y4jkhqh5.fsf@uwakimon.sk.tsukuba.ac.jp> <557F3C22.4060909@cs.ucla.edu> <5580D356.4050708@cs.ucla.edu> <87si9qonxb.fsf@gnu.org> <87ioamz8if.fsf@petton.fr> <32013464-2300-46c6-ba46-4a3c36bfee5d@default> <87twu62nnt.fsf@mbork.pl> <87oakdfwim.fsf@uwakimon.sk.tsukuba.ac.jp> <83wpz1lh7c.fsf@gnu.org> <83oakdl7yj.fsf@gnu.org> <83ioall3x5.fsf@gnu.org> <87h9pzxtyi.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1435100640 13352 80.91.229.3 (23 Jun 2015 23:04:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Jun 2015 23:04:00 +0000 (UTC) Cc: "Stephen J. Turnbull" , Eli Zaretskii , Stefan Monnier , emacs-devel To: Artur Malabarba Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 24 01:03:50 2015 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 1Z7XEM-0000I2-LB for ged-emacs-devel@m.gmane.org; Wed, 24 Jun 2015 01:03:50 +0200 Original-Received: from localhost ([::1]:47779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7XEL-000426-Hj for ged-emacs-devel@m.gmane.org; Tue, 23 Jun 2015 19:03:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7XE9-00041u-L8 for emacs-devel@gnu.org; Tue, 23 Jun 2015 19:03:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7XE8-0006UA-Da for emacs-devel@gnu.org; Tue, 23 Jun 2015 19:03:37 -0400 Original-Received: from hapkido.dreamhost.com ([66.33.216.122]:46759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7XE2-0006Ro-VL; Tue, 23 Jun 2015 19:03:31 -0400 Original-Received: from homiemail-a76.g.dreamhost.com (sub3.mail.dreamhost.com [69.163.253.7]) by hapkido.dreamhost.com (Postfix) with ESMTP id 065E89E82B; Tue, 23 Jun 2015 16:03:29 -0700 (PDT) Original-Received: from homiemail-a76.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTP id 1DD3A458085; Tue, 23 Jun 2015 16:03:28 -0700 (PDT) Original-Received: from localhost.linkov.net (m83-191-167-128.cust.tele2.ee [83.191.167.128]) (Authenticated sender: jurta@jurta.org) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTPA id 4DF33458083; Tue, 23 Jun 2015 16:03:26 -0700 (PDT) In-Reply-To: (Artur Malabarba's message of "Tue, 23 Jun 2015 00:28:40 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 66.33.216.122 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:187460 Archived-At: >> Have you found a way to combine char-folding with case-folding? > > Yes. This particular patch uses regexps, so it works independently of > case-fold-search. That is, if case-fold-search is on, then you will get > case folding in addition to this. > >> (in https://lists.gnu.org/archive/html/emacs-devel/2015-02/msg00407.ht= ml >> another hard problem was char-folding with a combining character.) > > That works too. "a" matches both "=C3=A1" (the letter) and "a=CC=81" (a= letter with a > combining character). It would be easy also to allow "a=CC=81" match "a" (by normalizing the original search string like "A" matches "a" in case insensitive mode), but this could be added later. Regarding the usage of the regexp, please consider a simpler way to use your character-folding regexp that would be just: (define-key isearch-mode-map "\M-sd" 'isearch-toggle-character-fold) (defun isearch-toggle-character-fold () (interactive) (setq isearch-word (unless (eq isearch-word 'isearch--character-folded-= regexp) 'isearch--character-folded-regexp)) (if isearch-word (setq isearch-regexp nil)) (setq isearch-success t isearch-adjusted t) (isearch-update)) (put 'isearch--character-folded-regexp 'isearch-message-prefix "char-fold= ")