branch: scratch/mheerdegen-preview
commit feede7d8c8f2d77beb35806ffbfdcb64eb589628
Author: Michael Heerdegen <[email protected]>
Commit: Michael Heerdegen <[email protected]>
WIP: [el-search] Fine tune separator for splicing replace
---
packages/el-search/el-search.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el
index b0af521..1ecfa8f 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/el-search.el
@@ -3959,7 +3959,11 @@ The return value is a marker pointing to the end of the
replacement."
(with-temp-buffer
(emacs-lisp-mode)
(insert (if splice
- (mapconcat #'el-search--pp-to-string replacement " ")
+ (let ((insertions (mapcar #'el-search--pp-to-string
replacement)))
+ (mapconcat #'identity insertions
+ (if (cl-some (apply-partially
#'string-match-p "\n")
+ insertions)
+ "\n" " ")))
(el-search--pp-to-string replacement)))
(goto-char 1)
(let (start this-sexp end orig-match-start orig-match-end done)