From 1d2e9a381e89ce14df3386d08f76f4012f202203 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 8 Aug 2015 19:39:15 -0400 Subject: slurp: Reduce new line stretches to single space ... instead of replacing each new line with a space. --- org-link-edit.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'org-link-edit.el') diff --git a/org-link-edit.el b/org-link-edit.el index a303adf..915591a 100644 --- a/org-link-edit.el +++ b/org-link-edit.el @@ -155,7 +155,7 @@ If N is negative, slurp leading blobs instead of trailing blobs." (user-error "Not enough blobs after the link")) (point))) (let ((slurped (buffer-substring-no-properties end (point)))) - (setq slurped (replace-regexp-in-string "\n" " " slurped)) + (setq slurped (replace-regexp-in-string "\n+" " " slurped)) (when (and (= (length desc) 0) (string-match "^\\s-+\\(.*\\)" slurped)) (setq slurped (match-string 1 slurped))) @@ -200,7 +200,7 @@ If N is negative, slurp trailing blobs instead of leading blobs." (when (and (= (length desc) 0) (string-match "\\(.*\\)\\s-+$" slurped)) (setq slurped (match-string 1 slurped))) - (setq slurped (replace-regexp-in-string "\n" " " slurped)) + (setq slurped (replace-regexp-in-string "\n+" " " slurped)) (setq desc (concat slurped desc) beg (- beg (length slurped))) (delete-region (point) end) -- cgit v1.2.3