branch: master commit 06f93eccd5df0405001fba3dcfcba94af9f2cfe8 Author: Michael Heerdegen <michael_heerde...@web.de> Commit: Michael Heerdegen <michael_heerde...@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. --- packages/el-search/NEWS | 6 ++++++ packages/el-search/el-search.el | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/el-search/NEWS b/packages/el-search/NEWS index cf1b425..a27b322 100644 --- a/packages/el-search/NEWS +++ b/packages/el-search/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/packages/el-search/el-search.el b/packages/el-search/el-search.el index 4a51f18..ee3b641 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/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