[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate be48989c98 299/372: - fixed 'annotate-previous-an
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate be48989c98 299/372: - fixed 'annotate-previous-annotation-ends' |
Date: |
Fri, 4 Feb 2022 16:59:10 -0500 (EST) |
branch: elpa/annotate
commit be48989c980a307c2d43b40a548deebc020171a8
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- fixed 'annotate-previous-annotation-ends'
'annotate-previous-annotation-ends' scans the buffer contents backward
looking for an annotation before a buffer position (let's' call this
position 'POS').
If an annotation exists on 'POS' the backward search starts from a
position less than the starts of said annotation.
But unfortunately in the local function ''annotate-previous-annotation-ends'
the test to stop the searching is wrong.
This is the code for the local function:
----
(cl-labels ((previous-annotation-ends (start)
(let ((annotation (annotate-annotation-at start)))
(while (and (/= start
(point-min))
(null annotation))
(setf start (previous-overlay-change start))
(setf annotation (annotate-annotation-at start)))
annotation)))
----
Let's assume that the annotation under 'POS' starts at (point-min), of
course this is the first annotation of the buffer and the function
should returns nil.
Then the initial value of 'start' (argument of the local function
above) is one less the starting of the annotation under 'POS' and -in
this case- values 0 (when '(point-min)' values 1) no annotations can
exist at 0 and, moreover, (/= start (point-min)) is non nil; therefore
the test passes and the results of the function is the annotation
under the position 'start' where 'start' get the value of
(previous-overlay-change start)).
The latter expression '(previous-overlay-change start)' return the
position in the buffer where there is a change in an overlay or
(point-min) if no change in overlay exists; in the case under
examination the expression returns (point-min) as the annotation under
'POS' is the first in the buffer.
In conclusion, the function returns the annotation under 'POS' as the
annotation that supposed to starts before the annotation under
'POS', instead of nil!
To reproduce the bug:
buffer contents
****
****
^^^
annotate this portion of the buffer
****
*aaa
then annotate all the non-annotated text.
AAAA
Aaaa
The coloring of the highlight of the two annotation will be the same
(wrong) while the background color of the annotation text is not
(which is correct).
---
annotate.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/annotate.el b/annotate.el
index 94c5cf29ef..46765ea64c 100644
--- a/annotate.el
+++ b/annotate.el
@@ -2058,7 +2058,7 @@ was found.
NOTE this assumes that annotations never overlaps"
(cl-labels ((previous-annotation-ends (start)
(let ((annotation (annotate-annotation-at start)))
- (while (and (/= start
+ (while (and (> start
(point-min))
(null annotation))
(setf start (previous-overlay-change start))
- [nongnu] elpa/annotate b8fd76f712 216/372: Merge pull request #60 from cage2/rethink-multiline-annotations, (continued)
- [nongnu] elpa/annotate b8fd76f712 216/372: Merge pull request #60 from cage2/rethink-multiline-annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a37ec08035 249/372: - added signalling of error to 'annotate-switch-db';, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 34f0df8d5b 251/372: - updated documentation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate bc89867f65 289/372: Merge pull request #92 from cage2/expand-db-path, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate be998ca006 263/372: Merge pull request #81 from cage2/popup-annotation, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 804c7b9421 257/372: - Removed internal link because of issue #79., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a9f061cecd 268/372: - added more docstrings., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 88ed6f22cb 285/372: - rewritten export and integrate of annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 463e215bec 284/372: - fixed export for annotated text made from a single line., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e53c0f5adf 296/372: - added checking encrypted (GPG) file format, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate be48989c98 299/372: - fixed 'annotate-previous-annotation-ends',
ELPA Syncer <=
- [nongnu] elpa/annotate 59ca58c06b 308/372: changed function from 'font-lock-ensure' to 'font-lock-flush'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f823c3cf09 354/372: - changed default for asking confirm before deleting an annotation: the value is now 'nil' (do not prompt for confirmation)., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3bb813cd62 360/372: - updated NEWS.org and Changelog., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 140eb6b6cb 363/372: - updated NEWS.org;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b22f594f3b 336/372: Merge pull request #107 from cage2/prevent-saving-empty-db, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate de86b9b22e 341/372: - removed uses of regular expressions from 'annotate-unwrap-text'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e083073ead 371/372: - updated Changelog;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 0901aa52bc 367/372: - added the others procedures to import an annotation database., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f08923762f 063/372: fix typo in documentation, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 16f7202d7c 091/372: - fixed docstring., ELPA Syncer, 2022/02/04