[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate d97139b566 121/372: - changed two function names
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate d97139b566 121/372: - changed two function names and reworded 'annotate-create-annotation' docstring |
Date: |
Fri, 4 Feb 2022 16:58:29 -0500 (EST) |
branch: elpa/annotate
commit d97139b566cee547fa7abc46bfdd43956a369055
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- changed two function names and reworded 'annotate-create-annotation'
docstring
in details:
from 'annotate-sample-text-of-annotation' to 'annotate-annotated-text'
from 'annotate-text-of-annotation' to
'annotate-annotation-string'
---
annotate.el | 66 +++++++++++++++++++++++++++++++++----------------------------
1 file changed, 36 insertions(+), 30 deletions(-)
diff --git a/annotate.el b/annotate.el
index ebad1636cd..9c19ba1a20 100644
--- a/annotate.el
+++ b/annotate.el
@@ -881,14 +881,14 @@ essentially what you get from:
(annotate-annotations-from-dump (annotate-load-annotations))). "
(cl-second annotation))
-(defun annotate-text-of-annotation (annotation)
+(defun annotate-annotation-string (annotation)
"Get the text of an annotation. The arg 'annotation' must be a single
annotation field got from a file dump of all annotated buffers,
essentially what you get from:
(annotate-annotations-from-dump (annotate-load-annotations))). "
(nth 2 annotation))
-(defun annotate-sample-text-of-annotation (annotation)
+(defun annotate-annotated-text (annotation)
"Get the annotated text of an annotation. The arg 'annotation' must be a
single
annotation field got from a file dump of all annotated buffers,
essentially what you get from:
@@ -912,9 +912,9 @@ essentially what you get from:
(when (not (null annotations))
(save-excursion
(dolist (annotation annotations)
- (let ((start (annotate-beginning-of-annotation annotation))
- (end (annotate-ending-of-annotation annotation))
- (text (annotate-text-of-annotation annotation)))
+ (let ((start (annotate-beginning-of-annotation
annotation))
+ (end (annotate-ending-of-annotation
annotation))
+ (annotation-string (annotate-annotation-string
annotation)))
(annotate-create-annotation start end text)))))
(set-buffer-modified-p modified-p)
(font-lock-fontify-buffer)
@@ -950,11 +950,11 @@ essentially what you get from:
(annotations
(save-excursion
(dolist (annotation annotations)
- (let ((start (annotate-beginning-of-annotation annotation))
- (end (annotate-ending-of-annotation annotation))
- (text (annotate-text-of-annotation annotation))
- (sample (annotate-sample-text-of-annotation annotation)))
- (annotate-create-annotation start end text sample))))))
+ (let ((start (annotate-beginning-of-annotation annotation))
+ (end (annotate-ending-of-annotation annotation))
+ (text (annotate-annotation-string annotation))
+ (note (annotate-annotated-text annotation)))
+ (annotate-create-annotation start end text note))))))
(set-buffer-modified-p modified-p)
(font-lock-fontify-buffer)
(when annotate-use-messages
@@ -982,19 +982,25 @@ essentially what you get from:
(or (null a)
(string= "" a)))
-(defun annotate-create-annotation (start end &optional text sample)
- "Create a new annotation for selected region. If this function
- is called from procedure 'annotate-load-annotations' the
- argument 'sample' should be not null. In this case we know that
- an annotation existed in a text interval defined in the database
- metadata (the database located in the file specified by the
- variable 'annotate-file') and should just be restored. Sometimes
- the annotated text can not be found in said interval because the
- annotated file's content changed and annotate-mode could not
- track the changes (e.g. save the file when annotate-mode was not
- active/loaded) in this case the matching text is searched in a
- region surrounding the interval and, if found, the buffer is
- annotated right there."
+(defun annotate-create-annotation (start end &optional annotation-text
annotated-text)
+ "Create a new annotation for selected region.
+
+ Here the argument 'annotation-text' is the string that appears in the margin
of the window
+ and 'annotated-text' is the string that is underlined.
+
+ If this function is called from procedure
+ 'annotate-load-annotations' the argument 'annotated-text'
+ should be not null. In this case we know that an annotation
+ existed in a text interval defined in the database
+ metadata (the database located in the file specified by the
+ variable 'annotate-file') and should just be
+ restored. Sometimes the annotated text (see above) can not be
+ found in said interval because the annotated file's content
+ changed and annotate-mode could not track the
+ changes (e.g. save the file when annotate-mode was not
+ active/loaded) in this case the matching
+ text ('annotated-text') is searched in a region surrounding the
+ interval and, if found, the buffer is annotated right there."
(cl-labels ((create-annotation (start end annotation-text)
(let ((highlight (make-overlay start
end)))
(overlay-put highlight 'face
'annotate-highlight)
@@ -1012,28 +1018,28 @@ essentially what you get from:
(go-forward (start)
(beginning-of-nth-line start
annotate-search-region-lines-delta))
- (guess-match-and-add (start end sample max)
+ (guess-match-and-add (start end annotated-text max)
(cl-block surrounding
(while (< start max)
(let ((to-match (ignore-errors
(buffer-substring-no-properties start
end))))
(if (and to-match
- (string= to-match sample))
+ (string= to-match
annotated-text))
(cl-return-from surrounding
start))
(progn
(setf start (1+ start)
end (1+ end)))))
nil)))
- (let ((annotation (or text
+ (let ((annotation (or annotation-text
(read-from-minibuffer "Annotation: "))))
(when (not (or (null annotation)
(string= "" annotation)))
- (if (not (annotate-string-empty-p sample))
+ (if (not (annotate-string-empty-p annotated-text))
(let ((text-to-match (ignore-errors
(buffer-substring-no-properties start
end))))
(if (and text-to-match
- (string= text-to-match sample))
+ (string= text-to-match annotated-text))
(create-annotation start end annotation)
(let* ((starting-point-matching (go-backward start))
(ending-point-match (go-forward start))
@@ -1041,7 +1047,7 @@ essentially what you get from:
(new-match (guess-match-and-add
starting-point-matching
(+
starting-point-matching
length-match)
- sample
+
annotated-text
ending-point-match)))
(and new-match
(create-annotation new-match (+ new-match length-match)
annotation)))))
@@ -1211,7 +1217,7 @@ essentially what you get from:
filename))
(dolist (annotation-field all-annotations)
(let* ((button-text (format "%s"
- (annotate-text-of-annotation
annotation-field)))
+ (annotate-annotation-string
annotation-field)))
(annotation-begin (annotate-beginning-of-annotation
annotation-field))
(annotation-end (annotate-ending-of-annotation
annotation-field))
(snippet-text (build-snippet filename
- [nongnu] elpa/annotate 1313777f03 098/372: - added args to local function., (continued)
- [nongnu] elpa/annotate 1313777f03 098/372: - added args to local function., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 0bbdbea410 095/372: - improved appereance of summary window, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate edaafc69a9 052/372: no more broken annotations with umlauts, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate c42db2cdf9 034/372: don't mark buffer as modified on load or clear, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 38eb69da8b 107/372: - added a secondary color for highlight and annotation text, the two, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate af6d1bd39a 055/372: tiny bugfix, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e77fc74bd2 036/372: change key binding to be more standard, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b032d2afe0 116/372: - changed function name: 'move-lines' -> 'beginning-of-nth-line'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ce8dfa5ae9 110/372: - added docstrings., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 584f27cd7a 120/372: - fixed region's limit to break an annotation;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d97139b566 121/372: - changed two function names and reworded 'annotate-create-annotation' docstring,
ELPA Syncer <=
- [nongnu] elpa/annotate 8e8d5d125e 130/372: - fixed macro: "annotate-with-inhibit-modification-hooks"., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate fbd21602e8 129/372: - refactored 'annotate-actual-file-name' and used where appropriate., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 7127180360 145/372: - added 'cl-' prefix to 'remove-if';, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e43d2f9e65 069/372: - fixed left margin of annotation, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a51b5239b9 062/372: fixes incorrect annotation display for wide characters, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 0d315a806e 105/372: - fixed first argument of 'lwarn';, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 1ed168a79e 131/372: Merge pull request #47 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate c8aea8392d 135/372: - rewritten filename juggling to make it works with info file in, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 286646bc0c 137/372: - made recongnizable code that refers to info file annotation. (2/3), ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 13391d9576 157/372: - expanded a comment and a docstring., ELPA Syncer, 2022/02/04