[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/lentic da6ab1268f 104/333: Change locations now use mar
From: |
ELPA Syncer |
Subject: |
[elpa] externals/lentic da6ab1268f 104/333: Change locations now use markers. |
Date: |
Tue, 27 Feb 2024 13:00:12 -0500 (EST) |
branch: externals/lentic
commit da6ab1268f3bebf0e0284008c2469f947d19b304
Author: Phillip Lord <phillip.lord@newcastle.ac.uk>
Commit: Phillip Lord <phillip.lord@newcastle.ac.uk>
Change locations now use markers.
Previously, the begin and end position of changes were stored as
integers, which became invalid as the buffer is changed. Now use markers
instead.
---
linked-buffer-block.el | 43 ++++++++++++++++++++++++++-----------------
1 file changed, 26 insertions(+), 17 deletions(-)
diff --git a/linked-buffer-block.el b/linked-buffer-block.el
index 11fa488df8..79b589cd64 100644
--- a/linked-buffer-block.el
+++ b/linked-buffer-block.el
@@ -91,7 +91,7 @@ start of line comment-characters in appropriate blocks.
Changes
should only have occurred between BEGIN and END in BUFFER."
(-map
(lambda (pairs)
- (let*
+ (let*
((block-begin (car pairs))
(block-end (cdr pairs))
(rtn
@@ -105,7 +105,7 @@ should only have occurred between BEGIN and END in BUFFER."
(set-marker (car pairs) nil)
(set-marker (cdr pairs) nil)
rtn))
- (linked-buffer-blk-marker-boundaries
+ (linked-buffer-blk-marker-boundaries
conf buffer)))
(defun linked-buffer-blk-comment-region (conf begin end buffer)
@@ -137,21 +137,30 @@ start of line comment characters beween BEGIN and END in
BUFFER."
"Given CONF, a `linked-buffer-configuration' object, add
start of line comment-characters. Changes should only have occurred
between BEGIN and END in BUFFER."
- (-map
- ;; comment each of these regions
- (lambda (pairs)
- (let* ((block-begin (car pairs))
- (block-end (cdr pairs))
- (rtn
- (when
- (and (>= end block-begin)
- (>= block-end begin))
- (linked-buffer-blk-comment-region
- conf (car pairs) (cdr pairs) buffer))))
- (set-marker (car pairs) nil)
- (set-marker (cdr pairs) nil)
- rtn))
- (linked-buffer-blk-marker-boundaries conf buffer)))
+ ;; we need these as markers because the begin and end position need to
+ ;; move as we change the buffer, in the same way that the marker boundary
+ ;; markers do.
+ (let* ((begin (set-marker (make-marker) begin buffer))
+ (end (set-marker (make-marker) end buffer))
+ (rtn
+ (-map
+ ;; comment each of these regions
+ (lambda (pairs)
+ (let* ((block-begin (car pairs))
+ (block-end (cdr pairs))
+ (rtn
+ (when
+ (and (>= end block-begin)
+ (>= block-end begin))
+ (linked-buffer-blk-comment-region
+ conf (car pairs) (cdr pairs) buffer))))
+ (set-marker block-begin nil)
+ (set-marker block-end nil)
+ rtn))
+ (linked-buffer-blk-marker-boundaries conf buffer))))
+ (set-marker begin nil)
+ (set-marker end nil)
+ rtn))
(put 'unmatched-delimiter-error
'error-conditions
- [elpa] externals/lentic 55c389ec2a 096/333: Cosmetic Change, (continued)
- [elpa] externals/lentic 55c389ec2a 096/333: Cosmetic Change, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic e2fc6ce904 097/333: Re-enabled orgel-org tests., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 1dad92f20a 095/333: Switch to exact-subtract., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic e0840dbfe6 082/333: Stop location now calculated from before functions., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 6ed73a2ef5 088/333: Add string transform function., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 6c5fabb400 091/333: dev options added., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 03ed3f4da2 119/333: Force loading of m-buffer on opening., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 582d4d72b3 125/333: Search and Replace to lentic., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic a00f92e432 133/333: Refactor out a variable., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic a88717f0c4 102/333: Louder output for comments., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic da6ab1268f 104/333: Change locations now use markers.,
ELPA Syncer <=
- [elpa] externals/lentic 2dd5fcd6b3 105/333: Added let like macro to auto nil markers., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic e1941d0773 106/333: Easy mechanism to disable noisy fails., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 34d05cb7f9 108/333: Now uses random face., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic cebd7a744d 111/333: Add face as well as font-lock-face, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic bb986c0676 116/333: New test for empty line bug., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 772186d38f 122/333: Merge branch 'feature/incremental-blocks-update', ELPA Syncer, 2024/02/27
- [elpa] externals/lentic fce88ba411 123/333: Added marmalade for noflet., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 61d00b8ace 124/333: Files renamed to lentic., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 613556e708 127/333: Re-added .travis.yml after name change., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 123ef5f3f0 129/333: Documentation updates., ELPA Syncer, 2024/02/27