all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: bruce.connor.am@gmail.com, Eli Zaretskii <eliz@gnu.org>
Cc: Stephen Berman <stephen.berman@gmx.net>,
	Richard Stallman <rms@gnu.org>, emacs-devel <emacs-devel@gnu.org>
Subject: character folding future     [was: Questions about isearch]
Date: Sat, 28 Nov 2015 08:48:57 -0800 (PST)	[thread overview]
Message-ID: <893eaaa4-6867-4e3f-a926-85f650367d6f@default> (raw)
In-Reply-To: <CAAdUY-+jJ+XoJibdt3psNryQo5XckzDyxWoGY3tvE2sa5ai5Nw@mail.gmail.com>

> Ok. I'm going to work on the char-folding a little bit more today to
> implement support for multi-char matches and to combine it with
> case-folding. Hopefully that will iron out the final inconsistencies.

Thanks for working on this, Artur.  I invite you to also
take a look at some code I wrote for this, which I've put
in `character-fold+.el'.  It follows a previous discussion.

Any of that, or similar, that gets added to vanilla Emacs
will mean one less thing for me to bother with. ;-)

A description is here:
http://www.emacswiki.org/emacs/CharacterFoldPlus.
The code is here:
http://www.emacswiki.org/emacs/download/character-fold%2b.el

The additions are essentially these:

1. An option, `char-fold-ad-hoc', for the ad hoc char foldings.
   Default value: the same ad hoc foldings as vanilla Emacs
   (quotation marks).

2. A Boolean option, `char-fold-symmetric', which when non-nil
   means that all members of a folding equivalence class are
   treated equivalently, whether base char, compositions, or
   other strings of chars.  This lets you search for e' or é
   and find e and any of the other members of its class
   (including composition strings).  The default value is nil
   (off).

3. A general workhorse function, `update-char-fold-table',
   that updates the value of variable `character-fold-table'
   (from which it was derived).  It is used when option
   `char-fold-symmetric' is toggled, and it makes use of
   options `char-fold-ad-hoc' and `char-fold-symmetric'.

4. `character-fold-to-regexp' is advised, to reflect whether
   char folding is currently symmetric.

Library Isearch+ provides a toggle for `char-fold-symmetric',
bound by default to `M-s =' during Isearch.

Another Isearch toggle can be useful when char folding is
symmetric: `M-s h L', which toggles lazy highlighting, which
can slow things down when using symmetric char folding.

The code for `isearch+.el' is here:
http://www.emacswiki.org/emacs/download/isearch%2b.el


Earlier, I invited a discussion about future customization
of character folding (and folding in general).  That hasn't
happened, so far.  But `char-fold-ad-hoc' could be a start.

One possibility is for an alist option, whose entries would
each be a list (MODES CLASSES), where CLASSES is a list of
char-folding classes such as that of `char-fold-ad-hoc'.
When any of the MODES is current, those CLASSES would be
used by `update-char-fold-table'.

Users could thus:

1. Add their own equivalence classes.

2. Associate any number of such classes with particular modes.

3. Customize the ad hoc classes used by default.

In addition, we could provide the class that abstracts
from diacriticals explicitly, as another, non-customizable
(?) class, so that users could include or exclude it too
wrt specific modes.  (Currently it is implicit in char
folding, i.e., hard-coded.)

Letting users exclude the broad diacritical class and
include their own classes would accomodate wanting some
diacritical foldings but not others.  With symmetric
folding it should offer considerable flexibility.

Utility functions that do some of the work currently done
by `update-char-fold-table' could be created, to be used
by users to easily create their own diacritical classes.
Currently, that part is still hard-coded (only ad hoc
foldings are open to user customization, so far).



  parent reply	other threads:[~2015-11-28 16:48 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 18:41 Questions about isearch Eli Zaretskii
2015-11-25 19:20 ` Rasmus
2015-11-25 20:02   ` Steinar Bang
2015-11-26 14:46     ` Richard Stallman
2015-11-26 16:22       ` Eli Zaretskii
2015-11-26 20:46         ` Per Starbäck
2015-11-26 21:02           ` Eli Zaretskii
2015-11-26 21:35             ` Marcin Borkowski
2015-11-27  7:43               ` Eli Zaretskii
2015-11-27  6:38             ` Richard Stallman
2015-11-27  8:53               ` Eli Zaretskii
2015-11-27 16:21               ` raman
2015-11-26 23:18           ` Rasmus
2015-11-27  7:46             ` Eli Zaretskii
2015-11-27  6:37         ` Richard Stallman
2015-11-27  8:39           ` Eli Zaretskii
2015-11-25 20:10   ` Eli Zaretskii
2015-11-25 20:41     ` Mike Kupfer
2015-11-25 20:56       ` Eli Zaretskii
2015-11-25 20:14 ` Artur Malabarba
2015-11-25 20:30   ` Marcin Borkowski
2015-11-25 20:38     ` Eli Zaretskii
2015-11-25 21:58       ` Artur Malabarba
2015-11-25 23:04         ` Mike Kupfer
2015-11-26  3:40           ` Eli Zaretskii
2015-11-27 19:50             ` Mike Kupfer
2015-11-27 20:06               ` Eli Zaretskii
2015-11-27 23:57                 ` Artur Malabarba
2015-11-28  1:36                 ` Mike Kupfer
2015-11-28  9:28                   ` Eli Zaretskii
2015-11-26 13:28         ` Steinar Bang
2015-11-25 20:36   ` Eli Zaretskii
2015-11-25 21:49     ` Artur Malabarba
2015-11-26  3:34       ` Eli Zaretskii
2015-11-27 12:03     ` Artur Malabarba
2015-11-27 14:36       ` Eli Zaretskii
2015-11-27 16:50         ` Per Starbäck
2015-11-27 18:10           ` Artur Malabarba
2015-11-27 18:42             ` Per Starbäck
2015-11-27 21:33           ` raman
2016-02-28  0:27           ` Mathias Dahl
2016-02-28 15:58             ` Eli Zaretskii
2016-02-28 17:52               ` Mathias Dahl
2016-02-28 18:02                 ` Eli Zaretskii
2016-02-29 13:32                   ` Richard Stallman
2016-02-29 16:04                     ` Eli Zaretskii
2016-03-01 16:52                       ` Richard Stallman
2015-11-27 16:55         ` Artur Malabarba
2015-11-27 17:52           ` Eli Zaretskii
2015-11-27 21:18           ` Stephen Berman
2015-11-28  0:04             ` Artur Malabarba
2015-11-28  7:49               ` Eli Zaretskii
2015-11-28 16:14               ` Stephen Berman
2015-11-28  5:36             ` Richard Stallman
2015-11-28  8:33               ` Eli Zaretskii
2015-11-28  8:40               ` Marcin Borkowski
2015-11-28  9:46                 ` Eli Zaretskii
2015-11-28 10:23                   ` Artur Malabarba
2015-11-28 11:14                     ` Eli Zaretskii
2015-11-28 14:41                     ` Eli Zaretskii
2015-11-28 15:41                       ` Artur Malabarba
2015-11-28 16:29                         ` Artur Malabarba
2015-11-28 17:27                           ` Eli Zaretskii
2015-11-28 17:44                           ` Eli Zaretskii
2015-11-28 18:31                             ` Artur Malabarba
2015-11-28 18:57                               ` Eli Zaretskii
2015-11-28 20:00                                 ` Artur Malabarba
2015-11-28 20:08                                   ` Artur Malabarba
2015-11-28 20:47                                     ` Eli Zaretskii
2015-11-28 16:48                     ` Drew Adams [this message]
2015-11-28 18:34                       ` character folding future [was: Questions about isearch] Artur Malabarba
2015-12-01 11:34                       ` Artur Malabarba
2015-12-01 15:48                         ` Drew Adams
2015-12-03 23:54                           ` Artur Malabarba
2015-11-29  6:03                     ` Questions about isearch Richard Stallman
2015-11-29 15:48                       ` Eli Zaretskii
2015-11-29  9:39                     ` Andreas Röhler
2015-11-29 15:52                       ` Eli Zaretskii
2015-11-30  9:39                         ` Andreas Röhler
2015-11-30 15:53                           ` Eli Zaretskii
2015-11-30 16:05                       ` Paul Eggert
2015-11-26 16:08   ` Rasmus
2015-11-25 23:15 ` Mike Kupfer
2015-11-26 14:45 ` Richard Stallman
2015-11-27  0:43 ` Juri Linkov
2015-11-27  8:07   ` Eli Zaretskii
2015-11-27 23:24     ` Juri Linkov
2015-11-28  8:09       ` Eli Zaretskii
2015-11-27  8:02 ` Andreas Röhler
2015-11-27  8:57   ` Eli Zaretskii
2015-11-27 10:03     ` Artur Malabarba
2015-11-27 10:29       ` Eli Zaretskii
2015-11-27 10:47         ` Artur Malabarba
2015-11-29  9:08       ` Andreas Röhler

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

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

  git send-email \
    --in-reply-to=893eaaa4-6867-4e3f-a926-85f650367d6f@default \
    --to=drew.adams@oracle.com \
    --cc=bruce.connor.am@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    --cc=stephen.berman@gmx.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.