From 6b88755ae280590d4ac1cc208eaa27cecebe8a8f Mon Sep 17 00:00:00 2001 From: "Philip \"Galli\" Rentschler" Date: Tue, 30 Mar 2021 16:44:22 +0200 Subject: [PATCH] sp-kill-whole-line creates single kill-ring enrty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sp-kill-whole-line now creates only on (bigger) kill-ring entry: the killed text and the killed new-line. This makes its behaviour more consistent with the built-in commands 'kill-line and 'kill-whole-line, when it comes to yanking. Also repeated invocations or combinations with other kill-commands will behave this way, which is more compliant with the emacs-conventions. --- smartparens.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/smartparens.el b/smartparens.el index 68caef29..44721b11 100644 --- a/smartparens.el +++ b/smartparens.el @@ -6804,7 +6804,9 @@ Examples: (let ((empty-last-line (save-excursion (beginning-of-line) (eobp)))) ;; We can't kill the line if it is empty and the last line (when (and (sp-point-in-blank-line) (not empty-last-line)) - (kill-whole-line)))) + (append-next-kill) + (kill-whole-line) + (append-next-kill)))) (defun sp--transpose-objects (first second) "Transpose FIRST and SECOND object while preserving the