[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c24b6de 217/272: swiper.el (swiper-query-replace): Improve
From: |
Oleh Krehel |
Subject: |
[elpa] master c24b6de 217/272: swiper.el (swiper-query-replace): Improve "M-n" |
Date: |
Mon, 25 Apr 2016 10:13:26 +0000 |
branch: master
commit c24b6de1a2ce9e04b9b917b6ef8cbc9c09e09be7
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper-query-replace): Improve "M-n"
To replace a symbol with a similar symbol,
1. Press "C-s" "M-n" for `swiper' and select the symbol at point as input.
2. Press "M-q" for `swiper-query-replace'
3. Press "M-n" to yank the symbol to replace.
Here step-3 was modified to yank e.g. "symbol" instead of "\_<symbo\_>"
previously.
---
swiper.el | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/swiper.el b/swiper.el
index 6eb433f..b6b4c84 100644
--- a/swiper.el
+++ b/swiper.el
@@ -94,7 +94,13 @@
(user-error "Should only be called in the minibuffer through
`swiper-map'")
(let* ((enable-recursive-minibuffers t)
(from (ivy--regex ivy-text))
- (to (query-replace-read-to from "Query replace" t)))
+ (to (minibuffer-with-setup-hook
+ (lambda ()
+ (setq minibuffer-default
+ (if (string-match "\\`\\\\_<\\(.*\\)\\\\_>\\'"
ivy-text)
+ (match-string 1 ivy-text)
+ ivy-text)))
+ (read-from-minibuffer (format "Query replace %s with: "
from)))))
(swiper--cleanup)
(ivy-exit-with-action
(lambda (_)
- [elpa] master b3ca886 133/272: counsel.el (counsel--generic): Improve, (continued)
- [elpa] master b3ca886 133/272: counsel.el (counsel--generic): Improve, Oleh Krehel, 2016/04/25
- [elpa] master c8013c7 053/272: counsel.el (ivy-ffap-url-functions): Add Emacs git repo, Oleh Krehel, 2016/04/25
- [elpa] master 1d3f080 263/272: ivy.el (ivy--magic-file-slash): Allow "non-existing-dir//", Oleh Krehel, 2016/04/25
- [elpa] master 37d52cc 120/272: swiper.el (swiper--update-input-ivy): Replace "\t", Oleh Krehel, 2016/04/25
- [elpa] master 07624b3 180/272: Fix compilation warnings, Oleh Krehel, 2016/04/25
- [elpa] master f3b2640 124/272: swiper.el (swiper--ivy): Update signature, Oleh Krehel, 2016/04/25
- [elpa] master 25e1444 257/272: ivy.el (ivy-use-ignore-default): New defcustom, Oleh Krehel, 2016/04/25
- [elpa] master c9b6e02 230/272: Make sure user keybindings are respected, Oleh Krehel, 2016/04/25
- [elpa] master 5f58f9c 262/272: counsel.el (counsel--async-sentinel): Add safeguard to time-since, Oleh Krehel, 2016/04/25
- [elpa] master e5b7218 158/272: Fix swiper not revealing org overlay when at heading body end, Oleh Krehel, 2016/04/25
- [elpa] master c24b6de 217/272: swiper.el (swiper-query-replace): Improve "M-n",
Oleh Krehel <=
- [elpa] master c27cde2 072/272: ivy.el (ivy--reset-state): Don't deactivate region, Oleh Krehel, 2016/04/25
- [elpa] master a9205fa 232/272: counsel.el (counsel-expression-history): New command, Oleh Krehel, 2016/04/25
- [elpa] master 88169a3 147/272: "C-x C-f" can un-ignore dotfiles with a leading dot input, Oleh Krehel, 2016/04/25
- [elpa] master b4b8d3e 106/272: counsel.el: Organize the file with outlines, Oleh Krehel, 2016/04/25
- [elpa] master 2905d17 153/272: doc/ivy.org: fix typos, Oleh Krehel, 2016/04/25
- [elpa] master 4c81973 181/272: counsel.el (counsel-locate-cmd-es): Fix regex, Oleh Krehel, 2016/04/25
- [elpa] master 591c8fe 167/272: ivy.el (ivy-expand-file-if-directory): Fix "/ssh:" regression, Oleh Krehel, 2016/04/25
- [elpa] master 6817381 068/272: Allow to compose static collections with `counsel--async-command', Oleh Krehel, 2016/04/25
- [elpa] master 212a4b8 098/272: Update the documentation and the manual, Oleh Krehel, 2016/04/25
- [elpa] master b400fcc 108/272: counsel.el: Shuffle functions and rename headings, Oleh Krehel, 2016/04/25