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

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

[elpa] externals/lentic 236e942322 079/333: Move point to change locatio


From: ELPA Syncer
Subject: [elpa] externals/lentic 236e942322 079/333: Move point to change location.
Date: Tue, 27 Feb 2024 13:00:08 -0500 (EST)

branch: externals/lentic
commit 236e9423221306c17d5ef46e0dae192ac68ca530
Author: Phillip Lord <phillip.lord@newcastle.ac.uk>
Commit: Phillip Lord <phillip.lord@newcastle.ac.uk>

    Move point to change location.
    
    Previously, we were dependent on the current location of point
    which is not guaranteed to be the same as the change for bulk changes
    to the buffer such as rectangle operations.
---
 linked-buffer.el | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/linked-buffer.el b/linked-buffer.el
index ecafc57bab..9cd5809b2e 100644
--- a/linked-buffer.el
+++ b/linked-buffer.el
@@ -291,7 +291,7 @@ the linked-buffer."
 
 Currently, this is just a clone all method but may use regions in future."
  (let ((this-b (oref conf :this-buffer))
-        (that-b (oref conf :that-buffer)))
+       (that-b (oref conf :that-buffer)))
 
     (linked-buffer-log
      "(start, stop, length-before):(%s,%s,%s)" start stop length-before)
@@ -301,18 +301,22 @@ Currently, this is just a clone all method but may use 
regions in future."
             (length-before (or length-before (buffer-size that-b))))
         (with-current-buffer that-b
           (delete-region (max (point-min) (linked-buffer-convert conf start))
-                         (min (point-max) 
+                         (min (point-max)
                               (+ length-before
                                  (linked-buffer-convert conf start))))
-          (insert
-           (save-restriction
-             (with-current-buffer this-b
-               (widen)
-               ;; want to see where it goes
-               (propertize
-                (buffer-substring-no-properties
-                 start stop)
-                'face 'error)))))))))
+          (save-excursion
+            ;; used this three times now!
+            (goto-char (linked-buffer-convert conf start))
+            (insert
+             (save-restriction
+               (with-current-buffer this-b
+                 (widen)
+                 ;; want to see where it goes
+                 ;; hence the property
+                 (propertize
+                  (buffer-substring-no-properties
+                   start stop)
+                  'face 'error))))))))))
 
 (defun linked-buffer-default-init ()
   "Default init function.



reply via email to

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