branch: scratch/mheerdegen-preview
commit a8483cd6735dd8620e7a29cfe9442bf995766b42
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 3bea82f..cb9bcd4 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/el-search.el
@@ -3955,7 +3955,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)