emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ASCII-folded search [was: Re: Upcoming loss of usability ...]


From: Juri Linkov
Subject: Re: ASCII-folded search [was: Re: Upcoming loss of usability ...]
Date: Thu, 25 Jun 2015 00:44:47 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu)

> It's easy for things like “ⓐ” or “á”, which are single characters,
> normalizing a combination of multiple characters (like “á”) can get a
> little complicated. But then, I don't think we want to do either.

I'm testing your changes right now and noticed the following problem:

0. emacs -Q
1. C-h H (‘view-hello-file’)
2. C-s i (search for ‘i’)

matches such substrings as “in”, “iv”, ‘ii’ …

Maybe we should add explicit exceptions for such cases?

>> (define-key isearch-mode-map "\M-sd" 'isearch-toggle-character-fold)
>> (defun isearch-toggle-character-fold ()
>>   (interactive)
>>   (setq isearch-word (unless (eq isearch-word 
>> 'isearch--character-folded-regexp)
>>                        'isearch--character-folded-regexp))
>>   (if isearch-word (setq isearch-regexp nil))
>>   (setq isearch-success t isearch-adjusted t)
>>   (isearch-update))
>> (put 'isearch--character-folded-regexp 'isearch-message-prefix "char-fold ")
>
> Thanks, I was meaning to look into how to make it toggleable. Will
> that snippet make it ON by default? If not, how could I do that?

It doesn't enable by default, so it could be combined with the same logic
like in ‘isearch-toggle-case-fold’.  In any case we have to find a good
mnemonic key binding to toggle the new character-folding mode.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]