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

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

[elpa] externals/rec-mode da7b8c0 57/98: rec-mode: rec-end-of-field-pos


From: Stefan Monnier
Subject: [elpa] externals/rec-mode da7b8c0 57/98: rec-mode: rec-end-of-field-pos now works properly when a field ends with the end of file mark.
Date: Thu, 12 Nov 2020 13:18:40 -0500 (EST)

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

    rec-mode: rec-end-of-field-pos now works properly when a field ends with 
the end of file mark.
---
 etc/rec-mode.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/etc/rec-mode.el b/etc/rec-mode.el
index 41e8332..4910fcb 100644
--- a/etc/rec-mode.el
+++ b/etc/rec-mode.el
@@ -494,10 +494,7 @@ the pointer is not on a field."
         (when (looking-at rec-field-name-re)
           (goto-char (match-end 0)))
         (when (looking-at rec-field-value-re)
-          ;; The +1 is to include the \n at the beginning of the
-          ;; record value, that is part of the field but not part of
-          ;; the value
-          (+ (match-end 0) 1))))))
+          (match-end 0))))))
 
 (defun rec-beginning-of-comment-pos ()
   "Return the position of the beginning of the current comment,
@@ -1695,7 +1692,9 @@ will be used for fields of any type."
   (let ((begin-pos (rec-beginning-of-field-pos))
         (end-pos (rec-end-of-field-pos)))
     (when (and begin-pos end-pos)
-      (delete-region begin-pos end-pos))))
+      (delete-region begin-pos end-pos)
+      (when (equal (char-after) ?\n)
+        (delete-char 1)))))
 
 (defun rec-copy-record ()
   "Copy the current record"



reply via email to

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