From: Drew Adams <drew.adams@oracle.com>
To: bruce.connor.am@gmail.com
Cc: 22147@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
Subject: bug#22147: Obsolete search-forward-lax-whitespace
Date: Thu, 17 Dec 2015 14:16:26 -0800 (PST) [thread overview]
Message-ID: <9ec649c4-5d95-4192-8a73-cc438ad0e4aa@default> (raw)
In-Reply-To: <CAAdUY-LZ147yK7wyyowKGM_U9vFNHMyX7fTDdoDTvfF3j0LHKg@mail.gmail.com>
> > 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.
>
> I appreciate you probably put quite a bit of thought into this,
Only a few minutes of thought, as I imagine you can guess. It just
extends what I already have in character-fold.el.
> but IMO this would be over-engineering.
How so? I've done zero "engineering" on it. And I don't really care
how it gets done, as long as it does.
My point, as I said, is only this:
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.
Anything less than that is not serving users as well as they deserve, IMO.
As to how that is done, I really don't care. I offered one simple approach,
but you are welcome to over-, under- or just-right-engineer it your own way.
> I think we should define two simpole defcustoms that determine how the
> character-fold-table is generated: character-fold-ad-hoc (an alist)
> and character-fold-derive-from-unicode-decomposition (a boolean).
> This should be immediately configurable by anyone,
That's far too restrictive, IMO. It does not let users or libraries
easily apply different equivalence classes for different uses (e.g.
modes). And there is no reason for such restriction - nothing is
gained by it.
> without requiring a big initial investment.
There is no "big initial investment" to what I described. I can code
it up quickly, as I'm sure you can too.
And what it provides out of the box is exactly the same. It is just as
"immediately configurable by anyone" - and immediately configurable in
exactly the same way. Your Boolean with a default value of t is
equivalent to the default presence of the function that does what your
Boolean t does: "derive-from-unicode-decomposition".
You can do more with what I described, and more easily. But you can
also do just as little with it.
> Then we also make character-fold-table into a defvar, and document it
> as a proper exposed API, so advanced users
Anything that can be a defvar, for "advanced users", can be a defcustom,
for all users.
If you are inviting users to fiddle with a char-fold table, it is far
better to give them the ability to do so in a modular way, and to make
your default derive-from-unicode-decomposition into a default function
instead of just hard-coding the behavior. Nothing lost, modularity
and flexibility gained.
> can change it however they want with hooks and local vars to however
> many different values/equiv-classes they want.
Ugly, and complicated. And unnecessary. No need to be an "advanced
user" and fiddle with such stuff.
> This would offer a dead-simple defcustom that covers most cases, while
> still allowing the versatility of having multiple options for those
> who need it.
What I proposed is just as "dead-simple", but cleaner (IMO) and open
to all users. Just as importantly, it lets users (easily) define
multiple classes that they can (easily) use in different contexts.
Again, I don't care about the implementation, but I would like users
to be able to define their own equivalence classes (groups), and to
enable/disable them easily au choix.
next prev parent reply other threads:[~2015-12-17 22:16 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
2015-12-17 18:47 ` Artur Malabarba
2015-12-17 22:16 ` Drew Adams [this message]
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=9ec649c4-5d95-4192-8a73-cc438ad0e4aa@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).