unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dancol@dancol.org>
To: bruce.connor.am@gmail.com, Sebastien Vauban <sva-news@mygooglest.com>
Cc: 21140@debbugs.gnu.org
Subject: bug#21140: 25.0.50; Isearch "char-fold" by default
Date: Mon, 27 Jul 2015 18:16:47 -0700	[thread overview]
Message-ID: <55B6D7FF.5070806@dancol.org> (raw)
In-Reply-To: <CAAdUY-LFshq=bxjV4Qb3gDkUPbqDoJ3N3B-f8cJARMBqra7KTQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2023 bytes --]

On 07/27/2015 07:50 AM, Artur Malabarba wrote:
>> > Char fold search is a text search, not a regexp search. It does use
>> > a regexp underneath, but that should be invisible to the user. You
>> > type some text and it matches that text or similar texts.
>>
>> "Char fold" search is a "fuzzy" search, then, similar to
>> https://github.com/auto-complete/fuzzy-el?
> 
> Not quite. It just allows simple ascii characters to match their complex
> unicode counterparts.
> For instance, if you search for "a" you will also match "á" and "ã".
> 
>> What comes the name "char fold" from?  It's not very intuitive to me
>> that it's some sort of fuzzy search; moreover, it looks like "case fold"
>> search, which is again something different...
> 
> It is exactly like case fold. ;-)
> Where case folding folds together "a" and "A", char folding folds
> together "a", "á" and "ã".
> 
> The name is also something under discussion. Suggestions of something
> more intuitive are very much welcome.
> 

I've been using this bit of awfulness to solve the "char-fold" thing. It
hides "char-fold" by default and displays "raw" if we've turned off
char-folding. It still displays "raw regex isearch" though.

I like the idea of taking over the modeline to display isearch state.

(defun fix-isearch--describe-word-mode (word-mode &optional space-before)
  (let ((description
         (cond ((eq word-mode 'character-fold-to-regexp) "")
               ((and (symbolp word-mode)
                    (get word-mode 'isearch-message-prefix))
                (get word-mode 'isearch-message-prefix))
               (word-mode "word ")
               (t "raw "))))
    (if space-before
        ;; Move space from the end to the beginning.
        (replace-regexp-in-string "\\(.*\\) \\'" " \\1" description)
      description)))

(when (fboundp 'isearch--describe-word-mode)
  (advice-add 'isearch--describe-word-mode
              :override
              'fix-isearch--describe-word-mode))


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-07-28  1:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 13:45 bug#21140: 25.0.50; Isearch "char-fold" by default Sebastien Vauban
2015-07-27 14:24 ` Artur Malabarba
2015-07-27 22:33   ` Juri Linkov
2015-07-28  2:34     ` Eli Zaretskii
2015-07-28 22:21       ` Juri Linkov
     [not found]         ` <87h9only85.fsf-i9wRM+HIrmlRTR8OWt4JRw@public.gmane.org>
2015-07-29  9:01           ` Sebastien Vauban
2015-07-29 22:50             ` Juri Linkov
2015-07-29 23:11               ` Artur Malabarba
     [not found]             ` <mailman.7629.1438210748.904.bug-gnu-emacs@gnu.org>
     [not found]               ` <mailman.7629.1438210748.904.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2015-07-30  8:04                 ` Sebastien Vauban
2015-07-30 16:29                   ` Eli Zaretskii
2015-07-29 16:43         ` Eli Zaretskii
2015-07-29 22:51           ` Juri Linkov
2015-07-30  2:44             ` Eli Zaretskii
2015-07-30 21:21               ` Juri Linkov
     [not found] ` <mailman.7466.1438007109.904.bug-gnu-emacs@gnu.org>
     [not found]   ` <86vbd5n27r.fsf-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org>
2015-07-27 14:34     ` Sebastien Vauban
2015-07-27 14:50       ` Artur Malabarba
2015-07-28  1:16         ` Daniel Colascione [this message]
2015-07-28  9:13 ` Artur Malabarba
     [not found]   ` <CAAdUY-+xohOUpsJQ7HTsxj_e5=7NPLMuXrYKwAVre2qZr7my-g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-28  9:22     ` Sebastien Vauban
     [not found]   ` <mailman.7520.1438075448.904.bug-gnu-emacs@gnu.org>
     [not found]     ` <mailman.7520.1438075448.904.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2015-07-28  9:26       ` Sebastien Vauban
2015-07-28  9:47         ` Artur Malabarba
     [not found]         ` <mailman.7522.1438076888.904.bug-gnu-emacs@gnu.org>
     [not found]           ` <mailman.7522.1438076888.904.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2015-07-28  9:56             ` Sebastien Vauban
2015-07-28 13:12               ` Artur Malabarba
2016-04-30 12:10 ` bug#21140: Status: " Marcin Borkowski
2019-09-26 14:02 ` Stefan Kangas
2019-10-29  4:39   ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55B6D7FF.5070806@dancol.org \
    --to=dancol@dancol.org \
    --cc=21140@debbugs.gnu.org \
    --cc=bruce.connor.am@gmail.com \
    --cc=sva-news@mygooglest.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).