home · contact · privacy
Simplify plomvi-Y code.
authorChristian Heller <c.heller@plomlompom.de>
Fri, 15 Feb 2019 02:44:47 +0000 (03:44 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 15 Feb 2019 02:44:47 +0000 (03:44 +0100)
plomvi.el

index 34524fd35b0359fa5043df3a120e31005b2b7b0d..6c9df1d273c04bb7d01cb8cb3b3f7e77b52a7ba3 100644 (file)
--- a/plomvi.el
+++ b/plomvi.el
@@ -181,20 +181,14 @@ Note that this ignores killed rectangles."
            (start-end-pos (region-end))
            (region-start (progn
                            (goto-char start-start-pos)
-                           (beginning-of-line)
-                           (point)))
+                           (line-beginning-position)))
            (region-end (progn
                          (goto-char start-end-pos)
-                         (end-of-line)
-                         (+ 1 (point)))))
+                         (+ 1 (line-end-position)))))
       (copy-region-as-kill region-start region-end)
       (goto-char region-start)))
    (t
-    (let ((keep-pos (point))
-          (region-start (progn (beginning-of-line) (point)))
-          (region-end (progn (end-of-line) (+ 1 (point)))))
-      (copy-region-as-kill region-start region-end)
-      (goto-char keep-pos)))))
+    (copy-region-as-kill (line-beginning-position) (+ 1 (line-end-position))))))
 
 (defun plomvi-copy-region()
   "Copy marked region."