From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: char equivalence classes in search - why not symmetric? Date: Fri, 11 Sep 2015 09:31:33 -0700 (PDT) Message-ID: References: <2a7b9134-af2a-462d-af6c-d02bad60bbe8@default> <834mjecdy7.fsf@gnu.org> <38061f42-eaf1-47c6-b74d-f676ac952b18@default> <83r3miatvl.fsf@gnu.org> <21998.29683.916211.867479@a1i15.kph.uni-mainz.de> <9A972800-D8F0-4DA8-877E-07D5BDC2E1F9@gmail.com> <87oahd11i9.fsf@uwakimon.sk.tsukuba.ac.jp> <8cf269bc-69d8-4752-8506-de8d992512e1@default> <4f3b1db3-d3d2-480f-8662-fbf7c74aa67f@default> 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 1441989127 1070 80.91.229.3 (11 Sep 2015 16:32:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Sep 2015 16:32:07 +0000 (UTC) Cc: stephen@xemacs.org, jean.christophe.helary@gmail.com, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 11 18:31:55 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 1ZaREs-0005Lm-9B for ged-emacs-devel@m.gmane.org; Fri, 11 Sep 2015 18:31:50 +0200 Original-Received: from localhost ([::1]:57410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaREr-0004OG-OG for ged-emacs-devel@m.gmane.org; Fri, 11 Sep 2015 12:31:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaREm-0004O2-Fg for emacs-devel@gnu.org; Fri, 11 Sep 2015 12:31:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaREi-0000Od-FV for emacs-devel@gnu.org; Fri, 11 Sep 2015 12:31:44 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:43339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaREi-0000O0-9S; Fri, 11 Sep 2015 12:31:40 -0400 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t8BGVbto018832 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Sep 2015 16:31:38 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t8BGVbb5032459 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 11 Sep 2015 16:31:37 GMT Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t8BGVaVR005552; Fri, 11 Sep 2015 16:31:37 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 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:189840 Archived-At: > > Yes, that is the difference in our views. Sure, "with one > > character", but the flip side is that if you happen to have > > =C3=A9 in your search string, however it got there (e.g. by > > pasting), then with your preferred behavior you *cannot* > > use your search string to search for "any kind of e". >=20 > You are right, for what I originally proposed. It would be like the > current situation with case folding, that you can't paste in a search > string with capital letters and search for it in a case-independent way. Exactly. You cannot. But you can still (thankfully) explicitly toggle afterward using `M-c', to turn case folding back on. > However, in the case of case folding, we solve that by downcasing > text when pasting it into search strings. We could de-accent strings > too when pasting them. Actually, Emacs does *not* do that in the general case for pasting copied text. emacs -Q ; `case-fold-search' is t Copy uppercase A from some text to the kill ring. In a buffer that has both lowercase and uppercase a's: C-s M-e C-y ; Paste the uppercase A. It appears uppercase. C-s ; Only uppercase A's are found. It does what you describe only when you yank text at point (e.g., using `C-M-y' or `C-w'). The use case I've been insisting on is copying some text from anywhere (e.g., from a web browser outside Emacs). That text can contain any chars. But anyway, I can agree that what you describe (automatic downcasing and removal of accents) might be a reasonable possibility to consider. But what if a user then wants unfolded search, after such pasting? S?he then needs to toggle anyway. I don't prefer such a design because it is another automatic switching of "mode" (folding ON/OFF). It happens behind the user's back, trying to second-guess what is best for all users in all contexts: DWIM (do something hardcoded, which someone thought at design time everyone will want at runtime). You don't like using a toggle key, which I can understand. Without toggling, which makes intention explicit/clear, you must rely on these things: 1. The mode setting the folding behavior (ON/OFF) appropriately - e.g., Info turns it ON locally, regardless of a user's customization of global `case-fold-search'. (This is good.) 2. DWIM: uppercase or accented char in the search string turns folding on. Pasting into the search string strips pasted text of uppercase and accents. (Good for you, bad for me.) If that doesn't fit what a user wants in a given context (e.g., if s?he wants to search case-sensitively in Info) then s?he needs to toggle anyway. I suspect that you might exaggerate the inconvenience, even for yourself, of having to explicitly toggle when you want to change state/mode. I use a version of Isearch that requires such toggling, and in practice I rarely toggle! Why do I rarely need to toggle? Perhaps because: * I usually want case-sensitive search. * The cases where I do not are usually covered by #1: the mode (e.g. Info) DTRT locally. At any rate, perhaps we could agree that users can prefer different behaviors? And let Emacs give them the choice? At customization time at a minimum, and in some cases via an on-the-fly toggle key? (If you don't need such a toggle then you certainly don't need to worry about memorizing it. ;-))