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

character classes unrecognized #1977

Closed
joaocortes opened this issue Mar 21, 2019 · 3 comments
Closed

character classes unrecognized #1977

joaocortes opened this issue Mar 21, 2019 · 3 comments

Comments

@joaocortes
Copy link

@joaocortes joaocortes commented Mar 21, 2019

Calling swiper from a buffer that contains
ab

, I cannot search for the regexp a[b]. (Swiper refuses to accept the input, complaining with a match required warning).

My configuration,

(use-package avy)    
(avy-setup-default)
     (global-set-key (kbd "C-c C-j") 'avy-resume)
     (global-set-key (kbd "C-'") 'avy-goto-char-2)
(use-package counsel
  :init (ivy-mode 1)
  (setq ivy-use-virtual-buffers t)
  (setq ivy-count-format "(%d/%d) "))
(global-set-key (kbd "C-s") 'swiper)
@basil-conto
Copy link
Collaborator

@basil-conto basil-conto commented Mar 21, 2019

Sorry, I can't reproduce this. Can you please try to provide a minimal but detailed step-by-step reproduction recipe? (By "minimal" I mean: using the fewest possible settings deviating from emacs -Q or make plain.)

Here is what I tried:

  1. emacs -Q

  2. M-xpackage-initializeRET

  3. (avy-setup-default) C-j

  4. (setq ivy-count-format "(%d/%d) ") C-j

  5. ab

  6. M-xswiperRET

  7. a[b]

    ab

Granted, there's a brief but undesirable delay between typing a[b] and the match showing up, but it ultimately works.

@joaocortes
Copy link
Author

@joaocortes joaocortes commented Mar 26, 2019

I found the issue.

I usually search portuguese text, with a lot of characters like ç and ã.
To have emacs search modulus accent marks, I have

(setq search-default-mode #'char-fold-to-regexp) 

in my init file.

So now the issue is making swiper search modulus accent marks, wich is the same as #622, without
loosing the ability to use character classes. Now the minimal example is

(setq search-default-mode #'char-fold-to-regexp) 
(use-package avy)    
(avy-setup-default)
     (global-set-key (kbd "C-c C-j") 'avy-resume)
     (global-set-key (kbd "C-'") 'avy-goto-char-2)
(use-package counsel
  :init (ivy-mode 1)
  (setq ivy-use-virtual-buffers t)
  (setq ivy-count-format "(%d/%d) "))
(global-set-key (kbd "C-s") 'swiper)

@abo-abo abo-abo closed this in 78b62f2 Mar 27, 2019
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Mar 27, 2019

Mentioned this in README. Thanks.

astoff added a commit to astoff/swiper that referenced this issue Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants