branch: elpa/isl
commit a4d243be0c45838849e95d0b425746dc50cbde6f
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
Add assertions to query-replace and iedit
Refuse to start when there is nothing to replace.
---
isl.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/isl.el b/isl.el
index 032f7052ad3..c659ad75ff5 100644
--- a/isl.el
+++ b/isl.el
@@ -534,6 +534,7 @@ the initial position i.e. the position before launching
`isl-search'."
"Launch `query-replace' from isl.
Argument ARG have same meaning as in `query-replace'."
(interactive "P")
+ (cl-assert isl--item-overlays nil "Nothing yet to replace")
(let* ((style (isl-matching-style))
(regexp isl-pattern)
(start (overlay-start isl--last-overlay))
@@ -612,6 +613,7 @@ Arguments OCCURRENCE-REGEXP, BEG and END have same meaning
as in
"Start Iedit mode from `isl' using last search string as the regexp."
(interactive)
(cl-assert (require 'iedit nil t))
+ (cl-assert isl--item-overlays nil "Nothing yet to replace")
(let ((regexp (if (eq isl-search-function 'search-forward)
(regexp-quote isl-pattern)
isl-pattern))