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: char equivalence classes in search - why not symmetric? Date: Wed, 02 Sep 2015 01:45:45 +0300 Organization: LINKOV.NET Message-ID: <87fv2xpxll.fsf@mail.linkov.net> References: <2a7b9134-af2a-462d-af6c-d02bad60bbe8@default> <55E5C9AC.3010007@lanl.gov> <55E5F112.3090908@lanl.gov> 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 1441147704 13512 80.91.229.3 (1 Sep 2015 22:48:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Sep 2015 22:48:24 +0000 (UTC) Cc: Drew Adams , emacs-devel@gnu.org To: Davis Herring Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 02 00:48:14 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 1ZWuLb-0006kD-NG for ged-emacs-devel@m.gmane.org; Wed, 02 Sep 2015 00:48:11 +0200 Original-Received: from localhost ([::1]:59169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWuLb-0000mN-7e for ged-emacs-devel@m.gmane.org; Tue, 01 Sep 2015 18:48:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWuLW-0000ky-5H for emacs-devel@gnu.org; Tue, 01 Sep 2015 18:48:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWuLS-00036Y-V5 for emacs-devel@gnu.org; Tue, 01 Sep 2015 18:48:06 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:46661 helo=homiemail-a20.g.dreamhost.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWuLS-000364-Oy for emacs-devel@gnu.org; Tue, 01 Sep 2015 18:48:02 -0400 Original-Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id 968B17EC069; Tue, 1 Sep 2015 15:48:00 -0700 (PDT) Original-Received: from localhost.linkov.net (m212-53-118-114.cust.tele2.ee [212.53.118.114]) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPA id 6B6DE7EC063; Tue, 1 Sep 2015 15:47:59 -0700 (PDT) In-Reply-To: <55E5F112.3090908@lanl.gov> (Davis Herring's message of "Tue, 01 Sep 2015 12:40:18 -0600") 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: 69.163.253.7 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:189425 Archived-At: > I'm sorry: I thought it was obvious. For case folding, there are three > sets of characters that might be considered a match: [a], [A], and [aA]= . > The default Emacs behavior is to make "a" mean [aA] and "A" mean [A]. > For the (relatively rare) case in which [a] is desired, one can turn > case-fold-search off (e.g., with M-c). Then you gain [a] and lose [aA] > as a choice (you can't have all three from just two characters!). Or in a brief table: =E2=80=98C-s a=E2=80=99 matches [aA] =E2=80=98C-s a M-c=E2=80=99 matches [a] =E2=80=98C-s A=E2=80=99 matches [A] =E2=80=98C-s A M-c=E2=80=99 matches [aA] Substituting =E2=80=98A=E2=80=99 into =E2=80=98=C3=A4=E2=80=99 (other equ= ivalent chars omitted for brevity): =E2=80=98C-s a=E2=80=99 matches [a=C3=A4] =E2=80=98C-s a M-'=E2=80=99 matches [a] =E2=80=98C-s =C3=A4=E2=80=99 matches [=C3=A4] =E2=80=98C-s =C3=A4 M-'=E2=80=99 matches [a=C3=A4] I see no problem implementing the same. BTW, could this scheme be applied to whitespace matching as well? =E2=80=98C-s SPC=E2=80=99 matches [SPC TAB] =E2=80=98C-s SPC M-s SPC=E2=80=99 matches [SPC] =E2=80=98C-s TAB=E2=80=99 matches [TAB] =E2=80=98C-s TAB M-s SPC=E2=80=99 matches [SPC TAB] > How did that upper-case letter get there? Commands like C-w are carefu= l > not to add uppercase letters if there aren't already some. So the user > must have typed it explicitly, and so they were paying attention to cas= e > and have no need for a case-insensitive search. The only harm is if > they are inconsistent in their typing -- during something as brief as > isearch. Yanking a string with upper-case letters into Isearch does more harm by converting them into lower-case. I believe yanking a string should not strip diacritics either.