* A simpler, gentler version of char-fold-to-regexp
@ 2017-08-29 19:38 Eric Abrahamsen
0 siblings, 0 replies; only message in thread
From: Eric Abrahamsen @ 2017-08-29 19:38 UTC (permalink / raw
To: help-gnu-emacs
Hi,
I'm using char-fold-to-regexp to good effect in a user-facing search
routine: users can enter "Miriam", and match "Míriam".
It's a bit overkill for my purposes, though, as `char-fold-to-regexp'
effectively turns the whole search string into a perfect regexp, whereas
I want users to be able to use regexp-special characters in their search
strings. Ie, I'd like to leave the "^" in "^string" alone, and not turn
it into "[^^]". Really all I want is to create character regexps for
the range [a-zA-Z], and leave everything else alone. No multi-character
matches, no spaces, no char ranges, etc.
I figured it wouldn't be too hard to do a copy-paste number on the code
in char-fold.el, but I'm bogging down a bit at the heart of it. I just
can't wrap my head around what's happening in the
`make-decomp-match-char' internal function, in part because it's simply
doing way more than I need, in part because the unicode decomposition
table returns bytecode, which is confusing.
All I want in that inner function is to say: "If a character (for instance
?í) decomposes to a character within the range [a-zA-Z] (?i), then add
?í to the entry for ?i in my new char-table."
Can anyone show me what that would look like? All the rest of it I can
do.
Thanks,
Eric
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-08-29 19:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-29 19:38 A simpler, gentler version of char-fold-to-regexp Eric Abrahamsen
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.