[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 3e0d5f39b2 302/372: Merge pull request #98 from c
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 3e0d5f39b2 302/372: Merge pull request #98 from cage2/master |
Date: |
Fri, 4 Feb 2022 16:59:12 -0500 (EST) |
branch: elpa/annotate
commit 3e0d5f39b24eeded849c1c4903f9a75976732d2b
Merge: 17958167da ac55086d60
Author: cage2 <1257703+cage2@users.noreply.github.com>
Commit: GitHub <noreply@github.com>
Merge pull request #98 from cage2/master
Fixed 'annotate-previous-annotation-ends'
---
Changelog | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NEWS.org | 5 +++++
annotate.el | 6 ++---
3 files changed, 81 insertions(+), 3 deletions(-)
diff --git a/Changelog b/Changelog
index eda6db44cf..f6c6d26f1e 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,76 @@
+2021-02-05 cage
+
+ * annotate.el:
+
+ - 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).
+
2021-01-15 cage
* annotate.el:
diff --git a/NEWS.org b/NEWS.org
index db0714e246..f696b34d44 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -192,3 +192,8 @@
Optimized the code to speedup reading and saving of encrypted (with
GPG) annotated files.
+
+- 2021-02-05 V1.1.4 Bastian Bechtold, cage ::
+
+ Fixed highlight color of annotated text that starts from the first
+ character of the buffer's content.
diff --git a/annotate.el b/annotate.el
index 94c5cf29ef..dbd56f521b 100644
--- a/annotate.el
+++ b/annotate.el
@@ -7,7 +7,7 @@
;; Maintainer: Bastian Bechtold
;; URL: https://github.com/bastibe/annotate.el
;; Created: 2015-06-10
-;; Version: 1.1.3
+;; Version: 1.1.4
;; This file is NOT part of GNU Emacs.
@@ -58,7 +58,7 @@
;;;###autoload
(defgroup annotate nil
"Annotate files without changing them."
- :version "1.1.3"
+ :version "1.1.4"
:group 'text)
;;;###autoload
@@ -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 c21b95273e 177/372: Merge pull request #57 from cage2/master, (continued)
- [nongnu] elpa/annotate c21b95273e 177/372: Merge pull request #57 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 2ccdad1504 193/372: - starting with a new method to render multiline annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 71f316be2f 236/372: - added dependency on 'info'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 7a96192be2 248/372: - according to documentation the secon argument of 'signal' must be a list., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f2b085d279 288/372: - fixed typos., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 26ea8e3631 266/372: - prevented getting shared value for 'annotate-file' in '%load-annotation-data'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b505af0f27 300/372: - updated NEWS, Changelog and version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 17958167da 298/372: Merge pull request #96 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 784df37cba 313/372: - updated version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9cdc2a90fb 350/372: - added prompt to confirm deletion also when deleting annotation's text;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3e0d5f39b2 302/372: Merge pull request #98 from cage2/master,
ELPA Syncer <=
- [nongnu] elpa/annotate cb8212830d 317/372: - added feature when the customizable variable, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ff3a0089e0 330/372: Merge pull request #102 from cage2/prevent-prompt-annotating-newline, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 1a09f78be9 322/372: - added comments to local functions of 'annotate-annotate'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 1e7bc9c886 364/372: - updated Changelog., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 5bc3415d56 353/372: - used 'yes-or-no-p' (customizable via a variable) to ask for deletion confirm., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate eaf96d584f 349/372: - added confirmation prompt before delete an annotation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e37820134f 332/372: - updated NEWS, Changelog and version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 2f4cbcdb3d 324/372: - fixed indentation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate c737b516b8 361/372: Merge pull request #114 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f65d10ac99 008/372: improve faces, ELPA Syncer, 2022/02/04