unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: bruce.connor.am@gmail.com, Juri Linkov <juri@linkov.net>
Cc: 22147@debbugs.gnu.org
Subject: bug#22147: Obsolete search-forward-lax-whitespace
Date: Thu, 17 Dec 2015 09:21:05 -0800 (PST)	[thread overview]
Message-ID: <d3618c0f-07a3-48e6-b3f7-a56b5ef747b2@default> (raw)
In-Reply-To: <CAAdUY-Jyvpr=cvu4gSN7QfTXQq5Vi=qoHXh7SsXDJ94+1c7oRg@mail.gmail.com>

>> 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. 

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:

((?\" """ "“" "”" "”" "„" "⹂" "〞" "‟" "‟" "❞" "❝"
      "❠" "“" "„" "〝" "〟" "🙷" "🙶" "🙸" "«" "»")
 (?' "❟" "❛" "❜" "‘" "’" "‚" "‛" "‚" "󠀢" "❮" "❯" "‹" "›")
 (?` "❛" "‘" "‛" "󠀢" "❮" "‹"))

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.





  reply	other threads:[~2015-12-17 17:21 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 23:52 bug#22147: Obsolete search-forward-lax-whitespace Juri Linkov
2015-12-12  0:44 ` Artur Malabarba
2015-12-12 23:31   ` Juri Linkov
2015-12-13  0:29     ` Artur Malabarba
2015-12-14  0:23       ` Juri Linkov
2015-12-14  1:11         ` Artur Malabarba
2015-12-14 23:58           ` Juri Linkov
2015-12-15 10:15             ` Artur Malabarba
2015-12-16  0:57               ` Juri Linkov
2015-12-16  1:47                 ` Drew Adams
2016-05-14 20:45                   ` Juri Linkov
2016-05-14 22:20                     ` Artur Malabarba
2016-05-14 22:27                       ` Drew Adams
2016-05-15 20:45                       ` Juri Linkov
2016-05-14 22:22                     ` Drew Adams
2016-05-15 20:56                       ` Juri Linkov
2016-05-15 21:51                         ` Drew Adams
2016-05-17 20:55                           ` Juri Linkov
2016-05-17 21:55                             ` Drew Adams
2016-05-18  3:00                               ` Artur Malabarba
2016-05-18 19:34                                 ` Juri Linkov
2016-05-18 20:40                                   ` Artur Malabarba
2016-05-30 20:57                                     ` Juri Linkov
2016-06-01 15:03                                       ` Artur Malabarba
2020-09-05 14:54                                         ` Lars Ingebrigtsen
2020-09-07 18:34                                           ` Juri Linkov
2015-12-16 10:59                 ` Artur Malabarba
2015-12-17  0:57                   ` Juri Linkov
2015-12-17 16:33                     ` Artur Malabarba
2015-12-17 17:21                       ` Drew Adams [this message]
2015-12-17 18:47                         ` Artur Malabarba
2015-12-17 22:16                           ` Drew Adams
2015-12-18  0:55                             ` Artur Malabarba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d3618c0f-07a3-48e6-b3f7-a56b5ef747b2@default \
    --to=drew.adams@oracle.com \
    --cc=22147@debbugs.gnu.org \
    --cc=bruce.connor.am@gmail.com \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).