unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22541: 25.0.50; highlight-regexp from isearch has is case-sensitive even if case-fold is active
@ 2016-02-03  6:29 Dima Kogan
  2016-03-01  0:14 ` Juri Linkov
  0 siblings, 1 reply; 13+ messages in thread
From: Dima Kogan @ 2016-02-03  6:29 UTC (permalink / raw)
  To: 22541

This is an offshoot of #22520:


Juri Linkov wrote:

> > Another possible side effect of this is that highlighting
> >
> >   Database directory:
> >
> > doesn't work: hi-lock goes through the motions but nothing ends up being
> > highlighted. Turning off char-folding fixes that.
>
> Actually “Database directory:” is not highlighted due to case-folding.
> After toggling case-folding with ‘M-s c’ and preserving the capital D,
> it's highlighted correctly.

This is true! And it's really weird... The user expectation is that if
we highlight something (M-s h r) directly from isearch, then at least
the thing isearch was finding would be highlighted, and here this
doesn't happen. So a slightly simpler example is:

0: Let the buffer have the string Ab
1: put the point on A
2: C-s
3: C-w (to isearch the whole thing)
4: M-s h r enter

Then Ab isn't found because we defaulted to char-folding, and the regex was

  \(?:a[̀-̄̆-̨̣̥̊̌̏̑]\|[aªà-åāăąǎȁȃȧᵃḁạảₐⓐa𝐚𝑎𝒂𝒶𝓪𝔞𝕒𝖆𝖺𝗮𝘢𝙖𝚊]\)\(?:b[̣̱̇]\|[bᵇḃḅḇⓑb𝐛𝑏𝒃𝒷𝓫𝔟𝕓𝖇𝖻𝗯𝘣𝙗𝚋]\)

This clearly has no case-folding active on top of the char-folding. But
the isearch had both, so the regex should get both. This would make the
regex twice as long, but it would be right, at least.

If we turn off char-folding (but leave case-folding alone; on) by adding
a step

2.5: M-s '

then the regex we get is

  [Aa][Bb]

which clearly has the case-folding, and works the way we expect.





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-05-21 23:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-03  6:29 bug#22541: 25.0.50; highlight-regexp from isearch has is case-sensitive even if case-fold is active Dima Kogan
2016-03-01  0:14 ` Juri Linkov
2016-04-27  5:02   ` Dima Kogan
2016-04-30 20:07     ` Juri Linkov
2020-05-21 23:23       ` Juri Linkov
2017-04-22 12:31   ` Tino Calancha
2017-04-23 23:18     ` Juri Linkov
2017-04-25  5:22       ` Tino Calancha
2017-04-25 20:52         ` Juri Linkov
2017-04-27 14:22           ` Tino Calancha
2017-05-09 22:10             ` Juri Linkov
2017-05-24 13:35               ` Tino Calancha
2017-05-25 12:11                 ` Tino Calancha

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