[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 30ee7a0b87 198/372: - fixed 'annotate-previous-an
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 30ee7a0b87 198/372: - fixed 'annotate-previous-annotation-ends' and 'annotate-next-annotation-ends' |
Date: |
Fri, 4 Feb 2022 16:58:59 -0500 (EST) |
branch: elpa/annotate
commit 30ee7a0b87920a3222eeef3b78865f7a7c0b0843
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- fixed 'annotate-previous-annotation-ends' and
'annotate-next-annotation-ends'
we was checking for an annotation but 'annotate-annotation-at' returned a
list
instead, now the latter return an annotation or nil.
---
annotate.el | 40 ++++++++++++++++++++++------------------
1 file changed, 22 insertions(+), 18 deletions(-)
diff --git a/annotate.el b/annotate.el
index 3a2d98d017..43666e9196 100644
--- a/annotate.el
+++ b/annotate.el
@@ -1410,27 +1410,31 @@ The searched interval can be customized setting the
variable:
(concat " \n" (make-string annotate-annotation-column ? ))
(make-string prefix-length ? )))))
-(defun annotate-annotations-at (pos)
+(defun annotate-annotation-at (pos)
"Returns the annotations (overlay where (annotationp overlay) -> t)
- at positions pos or nil if no annotations exists at pos"
- (cl-remove-if-not #'annotationp
- (overlays-at pos)))
+at positions pos or nil if no annotations exists at pos.
+
+NOTE this assumes that annotations never overlaps so the list of
+all annotations can contains only one element maximum."
+ (let ((all (cl-remove-if-not #'annotationp
+ (overlays-at pos))))
+ (cl-first all)))
(defun annotate-previous-annotation-ends (pos)
"Returns the previous annotation that ends before pos or nil if no annotation
was found.
NOTE this assumes that annotations never overlaps"
(cl-labels ((previous-annotation-ends (start)
- (let ((all-annotations (annotate-annotations-at start)))
+ (let ((annotation (annotate-annotation-at start)))
(while (and (>= (1- start)
(point-min))
- (null all-annotations))
+ (null annotation))
(setf start (1- start))
- (setf all-annotations (annotate-annotations-at (1-
start))))
- all-annotations)))
- (let ((all-annotations (annotate-annotations-at pos)))
- (if all-annotations
- (previous-annotation-ends (1- (overlay-start (cl-first
all-annotations))))
+ (setf annotation (annotate-annotation-at (1- start))))
+ annotation)))
+ (let ((annotation (annotate-annotation-at pos)))
+ (if annotation
+ (previous-annotation-ends (1- (overlay-start annotation)))
(previous-annotation-ends pos)))))
(defun annotate-next-annotation-starts (pos)
@@ -1438,16 +1442,16 @@ NOTE this assumes that annotations never overlaps"
was found.
NOTE this assumes that annotations never overlaps"
(cl-labels ((next-annotation-ends (start)
- (let ((all-annotations (annotate-annotations-at start)))
+ (let ((annotation (annotate-annotation-at start)))
(while (and (<= (1+ start)
(point-max))
- (null all-annotations))
+ (null annotation))
(setf start (1+ start))
- (setf all-annotations (annotate-annotations-at (1+
start))))
- all-annotations)))
- (let ((all-annotations (annotate-annotations-at pos)))
- (if all-annotations
- (next-annotation-ends (overlay-end (cl-first all-annotations)))
+ (setf annotation (annotate-annotation-at (1+ start))))
+ annotation)))
+ (let ((annotation (annotate-annotation-at pos)))
+ (if annotation
+ (next-annotation-ends (overlay-end annotation))
(next-annotation-ends pos)))))
(defun annotate-symbol-strictly-at-point ()
- [nongnu] elpa/annotate 6b73ccf009 352/372: - fixed function's name., (continued)
- [nongnu] elpa/annotate 6b73ccf009 352/372: - fixed function's name., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4c3ba3a5da 331/372: - prevented calling 'annotate--remove-annotation-property' on a narrowed buffer, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3b0bc40a4f 347/372: - improved docstrings;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 46aa377cfc 370/372: - upgraded version number;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 0cfad246ee 372/372: Merge pull request #120 from cage2/add-merge-db, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 401a9b4990 309/372: - removed useless argument for 'font-lock-flush'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ed0c9bc64b 184/372: - prevented annotation of text marked with a region that overlap with, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 24de0e4607 190/372: - renamed and fixed function to search for annotations relative to a, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e6fb2b31df 188/372: - fixed position to start for overlay checks in, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a81a7d9386 209/372: - updated versions;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 30ee7a0b87 198/372: - fixed 'annotate-previous-annotation-ends' and 'annotate-next-annotation-ends',
ELPA Syncer <=
- [nongnu] elpa/annotate 1143087515 213/372: - updated documentation., ELPA Syncer, 2022/02/04
- [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