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

How to use elisp expression when using swiper-query-replace? #2096

Closed
AmaiKinono opened this issue Jun 17, 2019 · 2 comments
Closed

How to use elisp expression when using swiper-query-replace? #2096

AmaiKinono opened this issue Jun 17, 2019 · 2 comments

Comments

@AmaiKinono
Copy link
Contributor

When using query-replace-regexp, \,(some-elisp-expression) can be used. e.g. \,(format "\n") can be used to represent a newline character, \,(1+ \#) is an incrementor from 1 (although I don't know exactly what \# is). But when using swiper-query-replace, these does not work. So how to use them?

abo-abo added a commit that referenced this issue Jun 25, 2019
…cessible

For example, suppose in swiper.el, we want to rename:

    (defTYPE swiper- to (defTYPE ivy

where TYPE is (group, face, fun, var ...).

1. `swiper-isearch' for "(def\sw+ swiper"
2. "M-q" to replace and "TAB" to get: "\,(concat \1 " " \2)"
3. Modify it to "\,(concat \1 " ivy")"

Re #2096
@abo-abo
Copy link
Owner

abo-abo commented Jun 25, 2019

Thanks, please test.

@AmaiKinono
Copy link
Contributor Author

It works!

astoff pushed a commit to astoff/swiper that referenced this issue Jan 1, 2021
…cessible

For example, suppose in swiper.el, we want to rename:

    (defTYPE swiper- to (defTYPE ivy

where TYPE is (group, face, fun, var ...).

1. `swiper-isearch' for "(def\sw+ swiper"
2. "M-q" to replace and "TAB" to get: "\,(concat \1 " " \2)"
3. Modify it to "\,(concat \1 " ivy")"

Re abo-abo#2096
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