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

Problem with prescient and swiper-query-replace on Emacs 28 #93

Open
skyler544 opened this issue Feb 6, 2021 · 3 comments
Open

Problem with prescient and swiper-query-replace on Emacs 28 #93

skyler544 opened this issue Feb 6, 2021 · 3 comments
Labels

Comments

@skyler544
Copy link

skyler544 commented Feb 6, 2021

clip
When using swiper-query-replace with prescient enabled, the prompt string is broken.

System info:

  • Distro: Arch Linux
  • Emacs: emacs-native-comp-git 28.0.50.146220-1

Expected behavior:

  • Prompt string: Query replace [query] with:

Actual behavior:

  • Prompt string: Query replace [a string of unrelated unicode characters like ȫⓝï][actual query] with:

The length of the string and the characters it is composed of seems different every time, but the actual query does show up at the end of the string.

Steps to reproduce:

  • Vanilla Emacs, version 28.0.50
  • Ivy, Swiper, and Prescient installed and enabled:
    • (require 'ivy)
    • (require 'ivy-prescient)
    • (require 'swiper)
    • M-x ivy-prescient-mode
    • M-x swiper
    • type something
    • M-q to open swiper-query-replace

EDIT: Added example screenshot for clarification

@okamsn
Copy link
Contributor

okamsn commented Feb 6, 2021

This looks like it's related to character folding, but I don't know why that would affect the prompt.

@raxod502
Copy link
Member

Yeah, so this is clearly related to character folding. In particular, you can run your query through char-fold-to-regexp and get exactly the string that is shown in the prompt (starting with a bunch of Unicode equivalents for c, then a bunch for o, and so on---because your query starts with co).

Apparently, swiper-query-replace uses some mechanism that goes through an interface advised by prescient.el. Not sure why that could be. It is quite bizarre.

@antoine-levitt
Copy link

FWIW, this also causes abo-abo/swiper#3017

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

No branches or pull requests

4 participants