]> git.eshelyaron.com Git - sweep.git/commit
ADDED: new command 'sweeprolog-query-replace-term'
authorEshel Yaron <me@eshelyaron.com>
Wed, 20 Sep 2023 11:00:00 +0000 (13:00 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 22 Sep 2023 15:00:23 +0000 (17:00 +0200)
commit1effbd3c95edbb3dbfe4131f86d0f8813835e3ab
tree4a9db3bd2c7618b2237f7378dc162a1647520513
parent526c1fae14f28cf2a7741bbe008bfac04db6281d
ADDED: new command 'sweeprolog-query-replace-term'

This patch extends the Term Search infrastructure to support
search-and-replace operations.  Namely, we replace the predicate
'sweep_term_search/2' with a new predicate 'sweep_term_replace/2' that
subsumes the functionality of the former.  The command
'sweeprolog-term-search' is greatly simplified and adjusted to work
with this new predicate, and we introduce a new command,
'sweeprolog-query-replace-term', that exposes the new
search-and-replace facility of 'sweep_term_replace/2' in an
interactive UI inspired by 'query-replace'.

* sweep.pl (sweep_term_search/2): Remove in favor of...
(sweep_term_replace/2): New predicate.
* sweeprolog.el: (sweeprolog-term-replace-edits): New function.
(sweeprolog-term-search): Rewrite.
(sweeprolog-term-search-last-search)
(sweeprolog-term-search-overlays)
(sweeprolog-term-search-repeat-count)
(sweeprolog-term-search-repeat-backward)
(sweeprolog-term-search-repeat-forward)
(sweeprolog-term-search-abort)
(sweeprolog-term-search-in-buffer)
(sweeprolog-term-search-next)
(sweeprolog-term-search-map): Remove, unused.
(sweeprolog-query-replace-term): New command.
(sweeprolog-mode-map): Bind it.
* sweeprolog-tests.el (term-search)
* sweep.texi (Term Search): Adjust.
(Term Replace): New section.
sweep.pl
sweep.texi
sweeprolog-tests.el
sweeprolog.el