[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/el-search 2a02a81 277/332: [el-search] Let el-search-qu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/el-search 2a02a81 277/332: [el-search] Let el-search-query-replace add undo boundaries |
Date: |
Tue, 1 Dec 2020 15:49:03 -0500 (EST) |
branch: externals/el-search
commit 2a02a816e8d77cfed4ab9ee64e2528a73b36f920
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>
[el-search] Let el-search-query-replace add undo boundaries
Also bump version to 1.8.3.
* packages/el-search/el-search.el
(el-search--search-and-replace-pattern): Add undo-boundaries before
and after each manual replacement so that it's possible to undo each
change individually afterwards.
---
NEWS | 6 ++++++
el-search.el | 11 ++++++++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/NEWS b/NEWS
index cf1b425..a27b322 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,12 @@
Some of the user visible news were:
+Version: 1.8.3
+
+ `el-search-query-replace' now adds undo boundaries for each manual
+ replacement so that afterwards `undo' undoes replacements
+ step-by-step similar to vanilla `query-replace'.
+
Version: 1.8
Several improvements in `el-search-query-replace':
diff --git a/el-search.el b/el-search.el
index 4a51f18..ee3b641 100644
--- a/el-search.el
+++ b/el-search.el
@@ -7,7 +7,7 @@
;; Created: 29 Jul 2015
;; Keywords: lisp
;; Compatibility: GNU Emacs 25
-;; Version: 1.8.2
+;; Version: 1.8.3
;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0"))
@@ -3955,6 +3955,7 @@ Ediff match with replacement")
(if (and replace-all
(not stopped-for-comments))
(funcall do-replace)
+ (undo-boundary)
(let* ((handle nil)
(replace-or-restore
(lambda ()
@@ -3974,7 +3975,9 @@ Ediff match with replacement")
(funcall edit-replacement ediff-only)
(unless (string= old-to-insert
to-insert)
(if (not replaced-this)
- (funcall replace-or-restore)
+ (progn
+ (funcall replace-or-restore)
+ (undo-boundary))
(el-search--message-no-log
"Already replaced this match - hit
r r to update")
(sit-for 2))))
@@ -4024,7 +4027,9 @@ Replace all matches in all buffers"))))
(?e (funcall edit-and-update
'ediff-only)
nil)
((or ?q ?\C-g ?\r) (signal
'quit t)))))
- (when handle (accept-change-group handle)))))
+ (when handle (accept-change-group handle))))
+ (when (and replaced-this (not replace-all))
+ (undo-boundary)))
(unless (eobp)
(let* ((replacement-contains-another-match
(and replaced-this
- [elpa] externals/el-search 76d63d9 326/332: [el-search] Extend possible search domains, (continued)
- [elpa] externals/el-search 76d63d9 326/332: [el-search] Extend possible search domains, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 0212cf9 328/332: * packages/el-search/el-search.el: New command el-search-repository, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 6df1362 332/332: * .gitignore: New file, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 6c0475e 212/332: Allow to save the current el-search to a register, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 7c19468 215/332: Fix el-search's to register save when no search started yet, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search c7709ab 233/332: Fix el-search's check for buffers visiting a given file, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search cda69ae 230/332: * el-search/el-search-x.el: New user option `el-search-lazy-l', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search ce8835b 242/332: [el-search] Factor out `el-search-backward', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search dfaa7f2 244/332: [el-search] Some more minor tweaks, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search a6c23b5 250/332: * el-search/el-search.el: Correct NOERROR argument uses, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 2a02a81 277/332: [el-search] Let el-search-query-replace add undo boundaries,
Stefan Monnier <=
- [elpa] externals/el-search 864f0ed 276/332: [el-search] Provide el-search-occur-search-object earlier, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 23cf24d 275/332: [el-search] Enhancements to my last two commits, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search effcb50 271/332: [el-search] Make r hit twice restore a replaced match, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search b9ba337 283/332: [el-search] Allow to work without installing key bindings, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 841a027 287/332: [el-search] Some optimization tweaks, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 70634b7 298/332: [el-search] Avoid bytecomp warning windows pop up, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 22c2f25 297/332: [el-search] Display colored defun match count, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 061464c 303/332: [el-search] Improvise eldoc support for search pattern prompt, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 9f4a9e5 310/332: [el-search] Improve "Make replacement editable and ediff'able", Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 3da4529 316/332: [el-search] Minor tweaks and version bump, Stefan Monnier, 2020/12/01