[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 2dabb8d886 196/372: Merge branch 'master' into re
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 2dabb8d886 196/372: Merge branch 'master' into rethink-multiline-annotations |
Date: |
Fri, 4 Feb 2022 16:58:58 -0500 (EST) |
branch: elpa/annotate
commit 2dabb8d886d73310e57a8c7313aea77b33c85347
Merge: 2ccdad1504 31e3c24726
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
Merge branch 'master' into rethink-multiline-annotations
---
Changelog | 20 +++++++++++++++-----
NEWS.org | 8 ++++++++
README.org | 3 +++
annotate.el | 56 +++++++++++++++++++++++++++++---------------------------
4 files changed, 55 insertions(+), 32 deletions(-)
diff --git a/Changelog b/Changelog
index 9d9f09e3fd..c616997871 100644
--- a/Changelog
+++ b/Changelog
@@ -2,8 +2,18 @@
* annotate.el (annotate--font-lock-matcher):
- fixed error for regexp search
- Sometimes some modes/package puts overlay on the last character of a
- buffer (notably SLIME when the parenthesis of a form are not
- balanced). This will make 're-search-forward' in the aforementioned
- function fails and font lock becomes a mess (e.g. text color
- disappears).
+ Sometimes some modes/package puts overlay on the last character of a
+ buffer (notably SLIME when the parenthesis of a form are not
+ balanced). This will make 're-search-forward' in the aforementioned
+ function fails and font lock becomes a mess (e.g. text color
+ disappears).
+
+2020-02-10 Bastian Bechtold, cage
+ * annotate.el (annotate--font-lock-matcher annotate-bounds
nnotate-symbol-strictly-at-point annotate-next-annotation-change
annotate-previous-annotation-change annotate-clear-annotations
annotate-annotate)
+ - prevented fails of fontification of annotated regions
+ As we walk across the overlays we can get past the limit;
+ - mark buffer as modified even if the only action the user performed
+ was clearing annotation (and at least an annotation was present in
+ the file)
+ - prevented annotation of text marked with a region that overlap with
+ an existing annotation.
diff --git a/NEWS.org b/NEWS.org
index 14f9889c14..15ff059ff9 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -85,3 +85,11 @@
- 2020-01-22 V0.5.1 Bastian Bechtold, cage ::
- fixed bug that prevented correct fontifications for major modes
that puts overlays on the buffer's text (e.g. SLIME).
+
+- 2020-02-10 V0.5.2 Bastian Bechtold, cage ::
+
+ - fixed bugs that makes some annotations overlaps;
+ - fixed some bugs in fontifications of multiline annotation;
+ - when the only user interactions, before saving, with a visited file was
+ the call of 'annotate-clear-annotations' the annotations
+ will shows again at reload, this should be fixed now.
diff --git a/README.org b/README.org
index 4439f50aa1..1345d344d8 100644
--- a/README.org
+++ b/README.org
@@ -114,6 +114,9 @@ as comments into the current buffer, like this:
incompatibility with the way source blocks are highlighted and the
way annotations are displayed.
+ Annotating a region that contains newline(s) can results in various
+ issues.
+
Deleting the first character of an annotated text will remove the
annotation (this turned out to be useful, though).
diff --git a/annotate.el b/annotate.el
index 5fb812e37b..e8146b83d4 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: 0.5.1
+;; Version: 0.5.2
;; This file is NOT part of GNU Emacs.
@@ -52,7 +52,7 @@
;;;###autoload
(defgroup annotate nil
"Annotate files without changing them."
- :version "0.5.1"
+ :version "0.5.2"
:group 'text)
;;;###autoload
@@ -1493,42 +1493,44 @@ The searched interval can be customized setting the
variable:
(make-string prefix-length ? )))))
(defun annotate-annotations-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)))
(defun annotate-previous-annotation-ends (pos)
- "Return the previous annotation that ends before pos or nil if no annotation
+ "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)))
- (if all-annotations
- (cl-first all-annotations)
- (if (> (1- start)
- (point-min))
- (previous-annotation-ends (1- start))
- nil)))))
- (let ((all-annotations (annotate-annotations-at pos)))
- (if all-annotations
- (previous-annotation-ends (1- (overlay-start (cl-first
all-annotations))))
- (previous-annotation-ends pos)))))
+ (let ((all-annotations (annotate-annotations-at start)))
+ (while (and (>= (1- start)
+ (point-min))
+ (null all-annotations))
+ (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))))
+ (previous-annotation-ends pos)))))
(defun annotate-next-annotation-starts (pos)
- "Return the previous annotation that ends before pos or nil if no annotation
+ "Returns the previous annotation that ends before pos or nil if no annotation
was found.
NOTE this assumes that annotations never overlaps"
- (cl-labels ((next-annotation-starts (start)
- (let ((all-annotations (annotate-annotations-at start)))
- (if all-annotations
- (cl-first all-annotations)
- (if (> (1+ start)
- (point-max))
- (previous-annotation-ends (1+ start))
- nil)))))
- (let ((all-annotations (annotate-annotations-at pos)))
- (if all-annotations
- (next-annotation-starts (overlay-ends (cl-first all-annotations)))
- (next-annotation-starts pos)))))
+ (cl-labels ((next-annotation-ends (start)
+ (let ((all-annotations (annotate-annotations-at start)))
+ (while (and (<= (1+ start)
+ (point-max))
+ (null all-annotations))
+ (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)))
+ (next-annotation-ends pos)))))
(defun annotate-symbol-strictly-at-point ()
"Return non nil if a symbol is at char immediately following
- [nongnu] elpa/annotate a370187f0b 151/372: - initial working on placing an annotation on its own line if too long., (continued)
- [nongnu] elpa/annotate a370187f0b 151/372: - initial working on placing an annotation on its own line if too long., ELPA Syncer, 2022/02/04
- [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 <=
- [nongnu] elpa/annotate e1a0917d98 197/372: - fixed 'annotate-previous-annotation-ends' and 'annotate-next-annotation-ends', ELPA Syncer, 2022/02/04
- [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