emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master a91ad33: [el-search] Fine tune separator for splicing repl


From: Michael Heerdegen
Subject: [elpa] master a91ad33: [el-search] Fine tune separator for splicing replace
Date: Fri, 15 Feb 2019 13:03:23 -0500 (EST)

branch: master
commit a91ad330a8ee5e196e7ecfe48cbfccd6e65d3c83
Author: Michael Heerdegen <address@hidden>
Commit: Michael Heerdegen <address@hidden>

    [el-search] Fine tune separator for splicing replace
    
    * packages/el-search/el-search.el
    (el-search--format-replacement): When splicing the replacement into
    the buffer and one of the expressions is multi-line, separate all
    expressions with newlines instead of spaces.
---
 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 d9787a4..1fcf81e 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/el-search.el
@@ -4045,7 +4045,11 @@ text."
           (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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]