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

feature request: auto-toggle case fold #126

Closed
Lompik opened this issue Dec 29, 2015 · 6 comments
Closed

feature request: auto-toggle case fold #126

Lompik opened this issue Dec 29, 2015 · 6 comments

Comments

@Lompik
Copy link

Lompik commented Dec 29, 2015

Is possible to have have case fold search activated (only for currently active search) on uppercase letter user input ? If I bother to to enter shoft+letter, most likely I want case fold on.

@abo-abo
Copy link
Owner

abo-abo commented Dec 29, 2015

See avy-case-fold-search.

@Lompik
Copy link
Author

Lompik commented Dec 29, 2015

Ok so the feature seems there but it isnt working as expected I think. in hte case of avy-goto-word-1 with letter "J", down in avy--regex-candidates, the regex is \\bJ. But then this:

(not (string= regex (upcase regex)))

will compare \\BJ and \\bJ so it will always be non-nil thus matches ignore case.

But then inside avy--regex-candidates even if I use:

(let ((case-fold-search nil)

still isn't working. The docs says "Automatically becomes buffer-local when set." so wondering if this is related.

@abo-abo
Copy link
Owner

abo-abo commented Dec 30, 2015

I don't see the problem, avy-goto-char with J will search only for J when avy-case-fold-search is nil, and for J and j when it's t. Works as expected.

@Lompik
Copy link
Author

Lompik commented Dec 30, 2015

I tested with emacs -Q and avy-goto-char works as expected but the actual problem is with avy-goto-word or any avy-* with a lowercase regex added to pattern. Basically the condition:

(not (string= regex (upcase regex)))

should be done on patterns not regexes. In the case of avy-goto-word, the regex is \\bJ , \\b for word boundary and J the pattern. (upcase regex) return \\BJ which is not equal to the original regex \\bJ. If it was done on the pattern then J (orginal) will match J (upcase).

@abo-abo abo-abo closed this as completed in 808bb80 Jan 5, 2016
@abo-abo
Copy link
Owner

abo-abo commented Jan 5, 2016

Should be better now, have a look

@Lompik
Copy link
Author

Lompik commented Jan 6, 2016

works great. See #128

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

No branches or pull requests

2 participants