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

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

[elpa] externals/rec-mode 20c3d6f 51/98: Do not kill the preceding empty


From: Stefan Monnier
Subject: [elpa] externals/rec-mode 20c3d6f 51/98: Do not kill the preceding empty line.
Date: Thu, 12 Nov 2020 13:18:39 -0500 (EST)

branch: externals/rec-mode
commit 20c3d6f9d9ee5d147f85264f120d8de20c320c9b
Author: Jose E. Marchesi <jemarch@gnu.org>
Commit: Antoine Kalmbach <ane@iki.fi>

    Do not kill the preceding empty line.
---
 etc/rec-mode.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/etc/rec-mode.el b/etc/rec-mode.el
index e09b3e7..a5f2b78 100644
--- a/etc/rec-mode.el
+++ b/etc/rec-mode.el
@@ -2012,7 +2012,7 @@ This command is especially useful with enumerated types."
     (if (and begin-pos end-pos)
         (progn
           (copy-region-as-kill begin-pos end-pos)
-          (message "Field copied to kill buffer"))
+          (message "Field copied to kill ring"))
       (message "Not in a field"))))
 
 (defun rec-cmd-kill-record ()
@@ -2022,9 +2022,10 @@ This command is especially useful with enumerated types."
         (end-pos (rec-end-of-record-pos)))
     (if (and begin-pos end-pos)
         (progn
-          (when (not (equal begin-pos (point-min)))
-            ;; Delete the newline before the record as well.
-            (setq begin-pos (- begin-pos 1)))
+          (when (looking-back "^[ \t]*")
+            ;; Delete the newline before the record as well, but do
+            ;; not include it in the kill ring.
+            (delete-region (match-beginning 0) (+ (match-end 0) 1)))
           (kill-region begin-pos end-pos))
       (message "Not in a record"))))
 
@@ -2036,7 +2037,7 @@ This command is especially useful with enumerated types."
     (if (and begin-pos end-pos)
         (progn
           (copy-region-as-kill begin-pos end-pos)
-          (message "record copied to kill buffer"))
+          (message "record copied to kill ring"))
       (message "Not in a record"))))
 
 ;;;; Definition of modes



reply via email to

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