[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate e1a0917d98 197/372: - fixed 'annotate-previous-an
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate e1a0917d98 197/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 e1a0917d98751b18f3f6563c5a67921bb5c7b368
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 e8146b83d4..46cf145464 100644
--- a/annotate.el
+++ b/annotate.el
@@ -1492,27 +1492,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)
@@ -1520,16 +1524,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 2292d5c6c8 160/372: - changed variable name from: 'text' to a more meaningful 'annotated text'., (continued)
- [nongnu] elpa/annotate 2292d5c6c8 160/372: - changed variable name from: 'text' to a more meaningful 'annotated text'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 54d112e8d3 174/372: [bugfix] mitigated bug that prevented rendering of annotation when, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 91412e5d65 175/372: - removed multiple, consecutive, spaces in comments., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ed6a7dd7cc 180/372: - prevented fails of fontification of annotated regions, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e4a7750e8c 183/372: - prevented overlapping of annotations when a symbol is already, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate eaffc1eba1 185/372: - mark buffer as modified even if the only action the user performed, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 7cf7f46be0 191/372: - removed duplicated function., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9c2bf1bd36 192/372: - used the correct functions when recurse., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 78fc74289f 194/372: - use iteration instead of recursion in, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 2dabb8d886 196/372: Merge branch 'master' into rethink-multiline-annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e1a0917d98 197/372: - fixed 'annotate-previous-annotation-ends' and 'annotate-next-annotation-ends',
ELPA Syncer <=
- [nongnu] elpa/annotate e7ca823566 201/372: Merge branch 'master' into org-mode-fix, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 2cf1a0b6d2 199/372: Merge branch 'master' into rethink-multiline-annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 818f66f4a3 203/372: Merge pull request #58 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate de116813be 211/372: Merge branch 'master' into rethink-multiline-annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 30f639c524 212/372: - fixed return value of 'maybe-force-newline-policy'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ece50f65fe 220/372: - fixed managing return value of "(get-text-property changed-face-pos 'face)", ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b25fb1ccab 224/372: - Increased version to 0.7.0., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a6097f6326 237/372: - updated NEWS, Changelog and version., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate abe23338cb 235/372: - ensured that the modified status of as buffer is not modified by the local, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 8481eaf0c2 245/372: - signalled an error when annotating a region and it overlaps with an existing annotation., ELPA Syncer, 2022/02/04