[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 1a09f78be9 322/372: - added comments to local fun
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 1a09f78be9 322/372: - added comments to local functions of 'annotate-annotate'. |
Date: |
Fri, 4 Feb 2022 16:59:15 -0500 (EST) |
branch: elpa/annotate
commit 1a09f78be9e04b672e6d249d29d3b91cd6d65e77
Author: cage <cage@localhost>
Commit: cage <cage@invalid>
- added comments to local functions of 'annotate-annotate'.
---
annotate.el | 38 ++++++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)
diff --git a/annotate.el b/annotate.el
index 908f44e875..a97d55c49c 100644
--- a/annotate.el
+++ b/annotate.el
@@ -567,6 +567,7 @@ specified by `from' and `to'."
"Create, modify, or delete annotation."
(interactive)
(cl-labels ((create-new-annotation ()
+ ;; create a new annotation in the region returned by
`annotate-bound'
(cl-destructuring-bind (start end)
(annotate-bounds)
(let ((annotation-text (read-from-minibuffer
annotate-annotation-prompt)))
@@ -575,6 +576,12 @@ specified by `from' and `to'."
(annotate-empty-annotation-text-error
(user-error "Annotation text is empty."))))))
(cut-right (region-beg region-stop &optional delete-enclosed)
+ ;; This function will trim on the right one or more
+ ;; existing chains of overlays that compose an
+ ;; annotation (i.e. the overlays applied on the
+ ;; annotated text). After this function is called the
+ ;; text staring from `region-beg' end ending on
+ ;; `region-stop' will be cleared of all annotations.
(let* ((last-of-chain-to-cut (annotate-chain-last-at
region-beg))
(first-of-chain-to-cut (annotate-chain-first-at
region-beg))
(chain-start (overlay-start
first-of-chain-to-cut))
@@ -590,6 +597,12 @@ specified by `from' and `to'."
(when delete-enclosed
(annotate-delete-chains-in-region chain-end region-stop))))
(cut-left (region-beg region-stop &optional delete-enclosed)
+ ;; This function will trim on the left one or more
+ ;; existing chains of overlays that compose an
+ ;; annotation (i.e. the overlays applied on the
+ ;; annotated text). After this function is called the
+ ;; text staring from `region-beg' end ending on
+ ;; `region-stop' will be cleared of all annotations.
(let* ((last-of-chain-to-cut (annotate-chain-last-at
region-stop))
(first-of-chain-to-cut (annotate-chain-first-at
region-stop))
(chain-start (overlay-start
first-of-chain-to-cut))
@@ -604,12 +617,25 @@ specified by `from' and `to'."
(annotate--cut-left-annotation last-of-chain-to-cut)))
(when delete-enclosed
(annotate-delete-chains-in-region chain-end region-stop))))
- (annotate-overwrite-line (eol bol)
- (goto-char bol)
+ (annotate-overwrite-range (start end)
+ ;; annotate text starting from `start' and ending on
+ ;; `end', overwriting any other annotation existing in
+ ;; that range
+ (goto-char end)
(push-mark (point) t t)
- (goto-char eol)
+ (goto-char start)
(annotate-annotate))
(annotate-line (eol)
+ ;; annotate a line that terminate at `eol'
+ ;;
+ ;; if the line contains no text before the newline
+ ;; annotate the next line with text, if any
+ ;;
+ ;; if the line contains a single annotation that spans
+ ;; the whole line update the existing annotation
+ ;;
+ ;; if the line contains no annotation annotate the
+ ;; whole line that terminate at `eol'
(let* ((bol
(annotate-beginning-of-line-pos))
(annotations-on-the-line
(annotate-annotations-overlay-in-range bol
eol)))
@@ -626,8 +652,8 @@ specified by `from' and `to'."
(push-mark start-overlay t t)
(annotate-change-annotation (overlay-start
annotation))
(pop-mark))
- (annotate-overwrite-line bol eol)))
- (annotate-overwrite-line bol eol)))))
+ (annotate-overwrite-range bol eol)))
+ (annotate-overwrite-range bol eol)))))
(let ((annotation (annotate-annotation-at (point))))
(cond
((use-region-p)
@@ -682,7 +708,7 @@ specified by `from' and `to'."
(save-excursion
(let* ((bol (annotate-beginning-of-line-pos))
(eol (point)))
- (if (/= eol bol) ; text before the newline,
annotate it
+ (if (/= eol bol) ; text before the newline, annotate
it
(annotate-line eol)
(progn ; no text before the new
; line, annotate next line
- [nongnu] elpa/annotate 7a96192be2 248/372: - according to documentation the secon argument of 'signal' must be a list., (continued)
- [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, 2022/02/04
- [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 <=
- [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
- [nongnu] elpa/annotate f31eddb523 044/372: fixed bug with annotation on bol, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 32e7d85fa2 039/372: don't save files with no annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e45381249f 046/372: fix bug that sometimes hid newlines, ELPA Syncer, 2022/02/04