Subject: Re: bug#22090: Isearch is sluggish and eventually refuses further service with "[Too many words]".

From: Eli Zaretskii <[email-masked]>
Date: Sat, 05 Dec 2015 19:32:17 +0200

> Date: Sat, 5 Dec 2015 17:23:53 +0000
> From: Artur Malabarba <[email-masked]>
> Cc: [email-masked]
> 
> nn2015-12-04 23:00 GMT+00:00 Alan Mackenzie <[email-masked]>:
> >> When case-fold-search is on the previous code would simply join these
> >> regexps with "\\(\\(a[´`]?\\|[áà𝑎]\\)\\|\\(A[`´]?\\|[ÁÀ]\\)\\)".
> >
> > Quick question: _why_ do you need to join them?  Given that
> > case-fold-search is enabled, couldn't you just use, say, the lower case
> > version?
> 
> Because there are some characters in each regexp that don't have
> lower/upper-case equivalents. For instance, if I use the
> "\\(\\(a[´`]?\\|[áà𝑎]\\)" regexp, that's enough to match A or À, but
> it's not enough to match a variety of other chars (𝔸𝕬𝖠𝗔𝘈𝘼𝙰🄰).

You don't need to match the latter set.  Character folding is applied
_after_ case folding, not before.  So characters that don't have a
lower-case variant simply shouldn't match a lower-case a -- and they
won't, if you just let case-insensitive regexp matching do its job.