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

Lacks isearch-query-replace #106

Open
yilkalargaw opened this issue Dec 9, 2021 · 5 comments
Open

Lacks isearch-query-replace #106

yilkalargaw opened this issue Dec 9, 2021 · 5 comments

Comments

@yilkalargaw
Copy link

I love this package but whenever I want to move to query replace from within isearch I get the message query-replace-read-from: Command attempted to use minibuffer while in minibuffer. I can't figure if this is a bug or if the package lacks this functionality. If the functionality is absent it might be worth adding since it is one of the core functionalities of buffer local text search.

@yilkalargaw yilkalargaw changed the title Lacks of isearch-query-replace Lacks isearch-query-replace Dec 18, 2021
@raxod502
Copy link
Member

Ah yes, there is no query-replace functionality in CTRLF. I wouldn't necessarily object to such a thing being added, although it would take a little bit of thought to do it in a way that's not a big mess (we don't want to simply invoke the existing query-replace logic, as that expects to operate within an Isearch context).

@kaofelix
Copy link

kaofelix commented Mar 2, 2023

I just started using the package and also love the overall experience, but I do miss the ability to switch to query-replace easily.

The docs here say that M-% in isearch just "invokes query-replace or query-replace-regexp (depending on search mode) with the current search string used as the string to replace".

Admittedly, I haven't looked into the code for isearch and didn't notice any deeper interaction between isearch and query-replace from use, in this case. So I wonder if it would be easy to just integrate query-replace to use the current search string being used by ctrlf? Or is your concern more about inconsistent user experience?

@raxod502
Copy link
Member

raxod502 commented Mar 3, 2023

Mmm, I was thinking of a CTRLF-native search-and-replace. But you're right that a lower lift solution would be to just invoke query-replace with the current search string. No objection to that.

@kaofelix
Copy link

kaofelix commented Mar 3, 2023

I gave a stab yesterday at writing a simple function for this, but couldn't get it to work... Granted, my Elisp knowledge is very sparse, I'm normally ad-hoc hacking a few things for my own usage.

I dug into the code for isearch-query-replace, and at a glance it doesn't look like they are straight just calling query-replace directly, but using some lower level APIs to realize the same work. When I have some free time I will see if I can understand the code better and try to replicate something similar for CTRLF. Happy to open a PR if I can come up with something.

BTW thanks for your hard work, love your packages!

@hab25
Copy link

hab25 commented Dec 14, 2023

See also #21

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

4 participants