[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate f829a1ece3 1/9: - fixed procedure for coloring an
|
From: |
ELPA Syncer |
|
Subject: |
[nongnu] elpa/annotate f829a1ece3 1/9: - fixed procedure for coloring annotations (adjacent annotations with the same colors was still possible). |
|
Date: |
Thu, 2 Nov 2023 10:00:07 -0400 (EDT) |
branch: elpa/annotate
commit f829a1ece3536548c579e8dbe95e65fcc1053c09
Author: cage <cage>
Commit: cage <cage@invalid>
- fixed procedure for coloring annotations (adjacent annotations with the
same colors was still possible).
---
annotate.el | 44 +++++++++++++++++++++++++-------------------
1 file changed, 25 insertions(+), 19 deletions(-)
diff --git a/annotate.el b/annotate.el
index 7c79b3e08c..7cbcb6c088 100644
--- a/annotate.el
+++ b/annotate.el
@@ -93,13 +93,15 @@ same directory that contains `filename'."
name of the local database annotation"
:type 'string)
-(defcustom annotate-highlight-faces '((:underline "coral")
- (:underline "khaki"))
+(defcustom annotate-highlight-faces '((:underline "#EEF192")
+ (:underline "#92EEF1")
+ (:underline "#F192EE"))
"List of faces for annotated text."
:type 'list)
-(defcustom annotate-annotation-text-faces '((:background "coral" :foreground
"black")
- (:background "khaki" :foreground
"black"))
+(defcustom annotate-annotation-text-faces '((:background "#EEF192"
:foreground "black")
+ (:background "#92EEF1"
:foreground "black")
+ (:background "#F192EE"
:foreground "black"))
"List of faces for annotation's text."
:type 'list)
@@ -2111,25 +2113,29 @@ interval and, if found, the buffer is annotated right
there.
The searched interval can be customized setting the variable:
'annotate-search-region-lines-delta'."
- (cl-labels ((face-index-annotation-shifting-point (position
shifting-direction-function)
+ (cl-labels ((face-annotation-shifting-point (position
shifting-direction-function)
(when-let* ((annotation (funcall
shifting-direction-function
position))
(annotation-face (annotate-annotation-face
annotation)))
- (cl-position-if (lambda (a) (cl-equalp annotation-face a))
- annotate-highlight-faces)))
- (face-index-annotation-before-point (position)
- (face-index-annotation-shifting-point position
-
#'annotate-previous-annotation-ends))
- (face-index-annotation-after-point (position)
- (face-index-annotation-shifting-point position
-
#'annotate-next-annotation-starts))
+ (cl-find-if (lambda (a) (cl-equalp annotation-face a))
+ annotate-highlight-faces)))
+ (face-annotation-before-point (position)
+ (face-annotation-shifting-point position
+
#'annotate-previous-annotation-ends))
+ (face-annotation-after-point (position)
+ (face-annotation-shifting-point position
+
#'annotate-next-annotation-starts))
+ (available-face-index (&rest used-faces)
+ (cl-position-if-not (lambda (a)
+ (cl-member a used-faces :test
#'cl-equalp))
+ annotate-highlight-faces))
(create-annotation (start end annotation-text)
- (when (null color-index)
- (when-let ((used-face-index (or
(face-index-annotation-before-point start)
-
(face-index-annotation-after-point end))))
- (setf annotate-colors-index-counter
- used-face-index)))
- (cl-incf annotate-colors-index-counter)
+ (if (null color-index)
+ (when-let ((new-face-index (available-face-index
(face-annotation-before-point start)
+
(face-annotation-after-point end))))
+ (setf annotate-colors-index-counter
+ new-face-index))
+ (cl-incf annotate-colors-index-counter))
(save-excursion
(let ((all-overlays ()))
(while (< start end)
- [nongnu] elpa/annotate updated (eae9e73f2e -> dfe0d7c990), ELPA Syncer, 2023/11/02
- [nongnu] elpa/annotate f829a1ece3 1/9: - fixed procedure for coloring annotations (adjacent annotations with the same colors was still possible).,
ELPA Syncer <=
- [nongnu] elpa/annotate 866fa6d3c0 4/9: - increased version number., ELPA Syncer, 2023/11/02
- [nongnu] elpa/annotate 0ddfb25fb3 7/9: - rephrased NEWS file entry., ELPA Syncer, 2023/11/02
- [nongnu] elpa/annotate 5f3cd007b2 5/9: - updated NEWS file., ELPA Syncer, 2023/11/02
- [nongnu] elpa/annotate 15668da450 6/9: - updated Changelog., ELPA Syncer, 2023/11/02
- [nongnu] elpa/annotate 3caa219b1f 3/9: - added saving of annotation face on the database., ELPA Syncer, 2023/11/02
- [nongnu] elpa/annotate 0e758967d0 8/9: - fixed README., ELPA Syncer, 2023/11/02
- [nongnu] elpa/annotate dfe0d7c990 9/9: Merge pull request #159 from cage2/master, ELPA Syncer, 2023/11/02
- [nongnu] elpa/annotate a1d5f3f9b7 2/9: - removed warning about unused parameter in function 'on-window-size-change';, ELPA Syncer, 2023/11/02