Subject: Re: bug#22541: 25.0.50; highlight-regexp from isearch has is case-sensitive even if case-fold is active

From: Juri Linkov <[email-masked]>
Date: Wed, 10 May 2017 01:10:03 +0300

>>> @@ -1950,7 +1950,12 @@ isearch-highlight-regexp
>>>  			      (regexp-quote s))))
>>>  			isearch-string ""))
>>>  		      (t (regexp-quote isearch-string)))))
>>> -    (hi-lock-face-buffer regexp (hi-lock-read-face-name)))
>>> +    (hi-lock-face-buffer regexp (hi-lock-read-face-name)
>>> +                         (if (and (eq isearch-case-fold-search t)
>>> +                                  search-upper-case)
>>> +                             (isearch-no-upper-case-p
>>> +                              isearch-string isearch-regexp)
>>> +                           isearch-case-fold-search)))
>>>    (and isearch-recursive-edit (exit-recursive-edit)))
>>
>> If this works reliably, then we could remove that ugly hack
>> from ‘isearch-highlight-regexp’, I mean the one with the comment
>> “Turn isearch-string into a case-insensitive regexp”.
> That's right.  We don't need such trick here anymore.  But this hack
> turned ut to be useful in hi-lock.el.
>
> The new patch, in addition to fix this bug report, it also
> helps with the 5. in bug#22520, that is:
> emacs -Q
> M-s hr t RET RET ; Highlight with regexp "[Tt]"
> M-s hu t RET ; Unhighlight the buffer.

Thanks, could you find more test cases that still don't work?