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

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

[elpa] externals/lentic 449c4d0bc1 098/333: Pass start and end through.


From: ELPA Syncer
Subject: [elpa] externals/lentic 449c4d0bc1 098/333: Pass start and end through.
Date: Tue, 27 Feb 2024 13:00:11 -0500 (EST)

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

    Pass start and end through.
---
 linked-buffer-block.el | 40 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 38 insertions(+), 2 deletions(-)

diff --git a/linked-buffer-block.el b/linked-buffer-block.el
index c1bd7d811f..6ce4343880 100644
--- a/linked-buffer-block.el
+++ b/linked-buffer-block.el
@@ -243,7 +243,25 @@ between the two buffers; we don't care which one has 
comments."
   ;; if the delimitors are unmatched, then we can do nothing other than clone.
   (condition-case e
       (linked-buffer-blk-uncomment-buffer
-       conf (point-min) (point-max) (linked-buffer-that conf))
+       conf
+       ;; the buffer at this point has been copied over, but is in an
+       ;; inconsistent state (because it may have comments that it should
+       ;; not). Still, the convertor should still work because it counts from
+       ;; the end
+       (linked-buffer-convert
+        conf
+        ;; point-min if we know nothing else
+        (or start (point-min)))
+       (linked-buffer-convert
+        conf
+        ;; if we have a stop
+        (if stop
+            ;; take stop (if we have got longer) or
+            ;; start length before (if we have got shorter)
+            (max stop
+                 (+ start length-before))
+          (point-max)))
+       (linked-buffer-that conf))
     (unmatched-delimiter-error
      nil)))
 
@@ -275,7 +293,25 @@ between the two buffers; we don't care which one has 
comments."
   (call-next-method conf start stop length-before)
   (condition-case e
       (linked-buffer-blk-comment-buffer
-       conf (point-min) (point-max) (linked-buffer-that conf))
+       conf
+       ;; the buffer at this point has been copied over, but is in an
+       ;; inconsistent state (because it may have comments that it should
+       ;; not). Still, the convertor should still work because it counts from
+       ;; the end
+       (linked-buffer-convert
+        conf
+        ;; point-min if we know nothing else
+        (or start (point-min)))
+       (linked-buffer-convert
+        conf
+        ;; if we have a stop
+        (if stop
+            ;; take stop (if we have got longer) or
+            ;; start length before (if we have got shorter)
+            (max stop
+                 (+ start length-before))
+          (point-max)))
+       (linked-buffer-that conf))
     (unmatched-delimiter-error nil)))
 
 (defmethod linked-buffer-invert



reply via email to

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