Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support char folding #56

Open
d12frosted opened this issue Aug 3, 2020 · 1 comment
Open

Support char folding #56

d12frosted opened this issue Aug 3, 2020 · 1 comment

Comments

@d12frosted
Copy link

Hello,

It seems that ctrlf doesn't support char-fold-to-regexp search mode (see search-default-mode). It would be lovely to get support of this feature as it helps searching text with diacritical marks. For example, consider the following buffer:

Bună dimineața
Buna dimineata

With isearch typing buna matches both variants, while ctrlf matches only the last one.

You can read more about this feature in the documentation of char-fold-to-regexp function or in pretty old post by Artur Malabarba.

Thanks in advance :)

@andersjohansson
Copy link
Contributor

As a workaround, I define the following as my default style. But this doesn't apply char fold when switching to alternate ctrlf styles.

(defun aj/ctrlf-translate-fuzzy-char-fold (input)
  (ctrlf-translate-fuzzy-regexp (char-fold-to-regexp input)))

(add-to-list
 'ctrlf-style-alist
 '(fuzzy-char-fold
   . (:prompt "fuzzy CF"
              :translator aj/ctrlf-translate-fuzzy-char-fold
              :case-fold ctrlf-no-uppercase-literal-p
              :fallback (isearch-forward . isearch-backward))))

(setq ctrlf-default-search-style 'fuzzy-char-fold)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants