From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#22147: Obsolete search-forward-lax-whitespace Date: Thu, 17 Dec 2015 09:21:05 -0800 (PST) Message-ID: References: <87wpsk7dcs.fsf@mail.linkov.net> <87d1ubz3w9.fsf@mail.linkov.net> <87r3ipoofk.fsf@mail.linkov.net> <87zixcblno.fsf@mail.linkov.net> <874mfjchp1.fsf@mail.linkov.net> <87mvt9evf9.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 1450373356 13903 80.91.229.3 (17 Dec 2015 17:29:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Dec 2015 17:29:16 +0000 (UTC) Cc: 22147@debbugs.gnu.org To: bruce.connor.am@gmail.com, Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 17 18:29:03 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1a9cMP-0001qY-RP for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Dec 2015 18:29:02 +0100 Original-Received: from localhost ([::1]:55315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9cMP-0007Px-7l for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Dec 2015 12:29:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9cFh-0004yF-7r for bug-gnu-emacs@gnu.org; Thu, 17 Dec 2015 12:22:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9cFe-0008I6-01 for bug-gnu-emacs@gnu.org; Thu, 17 Dec 2015 12:22:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9cFd-0008I2-TN for bug-gnu-emacs@gnu.org; Thu, 17 Dec 2015 12:22:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1a9cFd-0004IC-Mq for bug-gnu-emacs@gnu.org; Thu, 17 Dec 2015 12:22:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Dec 2015 17:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22147 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22147-submit@debbugs.gnu.org id=B22147.145037287616445 (code B ref 22147); Thu, 17 Dec 2015 17:22:01 +0000 Original-Received: (at 22147) by debbugs.gnu.org; 17 Dec 2015 17:21:16 +0000 Original-Received: from localhost ([127.0.0.1]:54638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a9cEu-0004HB-1T for submit@debbugs.gnu.org; Thu, 17 Dec 2015 12:21:16 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:19827) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a9cEs-0004Gy-5q for 22147@debbugs.gnu.org; Thu, 17 Dec 2015 12:21:14 -0500 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tBHHL7D7016487 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 17 Dec 2015 17:21:08 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id tBHHL7kF010891 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 17 Dec 2015 17:21:07 GMT Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id tBHHL671028519; Thu, 17 Dec 2015 17:21:06 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: aserv0022.oracle.com [141.146.126.234] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:110086 Archived-At: >> char-fold-symmetric could wait for later, but we definitely need >> char-fold-ad-hoc now before the release because the users should be >> able to customize the default rules. > > Indeed. Once we do that, we also need a variable to determine > whether we should derive the default table from the unicode > standard (like we currently do) or just use an empty default with > the ad-hoc rules slapped on top.=20 Users should be able to define their own equivalence classes (groups), not just one class. Each class should be the value of a user option. Here is one simple and flexible way to do this: 1. Define a user option, `char-folding-classes', which is a list of any number of (OPTION-NAME DOC-STRING) pairs, where OPTION-NAME is a symbol that will name a user option and DOC-STRING is its doc string. Each symbol would automatically be used to define an option (a defcustom) that the user can then use to define a given equivalence class. 2. The generated defcustom for each user option specified in option `char-folding-classes' would allow for any number of entries, each of which could be a `choice' of either of these defcustom types: a. An alist, such as used currently in my `char-fold-ad-hoc' option: Each entry is a list of a char and the strings that fold into it. b. A function that populates such an alist. The default value of `char-folding-classes' would be something like this: ((char-fold-diacriticals "Classes of chars equivalent because they have the same base char.") (char-fold-quotations "Classes of equivalent quotation-mark characters.")) Option `char-fold-diacriticals' would have as its default value a function that returns the alist of diacritical-equivalent classes that we provide today. Its code would be derived from what we use today. (If needed, a user can replace the function with another that defines some of the classes differently or that provides only a subset of the classes we provide today. But most users would probably not customize this option.) Option `char-fold-quotations' would have as its default value what I use as the default value of my `char-fold-ad-hoc', which is an alist of the quotation-mark equivalences provided today by character-fold.el: ((?\" "=EF=BC=82" "=E2=80=9C" "=E2=80=9D" "=E2=80=9D" "=E2=80=9E" "=E2=B9= =82" "=E3=80=9E" "=E2=80=9F" "=E2=80=9F" "=E2=9D=9E" "=E2=9D=9D" "=E2=9D=A0" "=E2=80=9C" "=E2=80=9E" "=E3=80=9D" "=E3=80=9F" "=F0=9F= =99=B7" "=F0=9F=99=B6" "=F0=9F=99=B8" "=C2=AB" "=C2=BB") (?' "=E2=9D=9F" "=E2=9D=9B" "=E2=9D=9C" "=E2=80=98" "=E2=80=99" "=E2=80=9A= " "=E2=80=9B" "=E2=80=9A" "=F3=A0=80=A2" "=E2=9D=AE" "=E2=9D=AF" "=E2=80=B9= " "=E2=80=BA") (?` "=E2=9D=9B" "=E2=80=98" "=E2=80=9B" "=F3=A0=80=A2" "=E2=9D=AE" "=E2=80= =B9")) Having an option that lets users define any number of classes, and having each class be defined by a user option, is flexible. Having multiple classes, each associated with a variable (option), lets users and libraries easily enable/disable different equivalence classes in different contexts.