[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate ed0c9bc64b 184/372: - prevented annotation of tex
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate ed0c9bc64b 184/372: - prevented annotation of text marked with a region that overlap with |
Date: |
Fri, 4 Feb 2022 16:58:57 -0500 (EST) |
branch: elpa/annotate
commit ed0c9bc64be9feb4e6eb4f18a3655682ebcef49f
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- prevented annotation of text marked with a region that overlap with
an existing annotation.
---
annotate.el | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/annotate.el b/annotate.el
index 83345484a2..f7e27e9ee6 100644
--- a/annotate.el
+++ b/annotate.el
@@ -346,19 +346,26 @@ modified (for example a newline is inserted)."
(defun annotate-annotate ()
"Create, modify, or delete annotation."
(interactive)
- (let ((overlay (car (overlays-at (point)))))
- (cond
- ((and (overlayp overlay)
- (overlay-get overlay 'annotation))
- (annotate-change-annotation (point))
- (font-lock-fontify-buffer nil))
- (t
- (cl-destructuring-bind (start end)
- (annotate-bounds)
- (let ((annotation-text (read-from-minibuffer
annotate-annotation-prompt)))
- (annotate-create-annotation start end annotation-text nil)
- (font-lock-fontify-block 1)))))
- (set-buffer-modified-p t)))
+ (cl-labels ((create-new-annotation ()
+ (cl-destructuring-bind (start end)
+ (annotate-bounds)
+ (let ((annotation-text (read-from-minibuffer
annotate-annotation-prompt)))
+ (annotate-create-annotation start end annotation-text
nil)))))
+ (let ((overlay (car (overlays-at (point)))))
+ (cond
+ ((use-region-p)
+ (let ((annotations (cl-remove-if-not #'annotationp
+ (overlays-in (region-beginning)
+ (region-end)))))
+ (if annotations
+ (message "Error: the region overlaps with at least an already
existings annotation")
+ (create-new-annotation))))
+ ((annotationp overlay)
+ (annotate-change-annotation (point))
+ (font-lock-fontify-buffer nil))
+ (t
+ (create-new-annotation)))
+ (set-buffer-modified-p t))))
(defun annotate-next-annotation ()
"Move point to the next annotation."
- [nongnu] elpa/annotate d2841bad65 325/372: - ensured all annotations are saved before showing summary window., (continued)
- [nongnu] elpa/annotate d2841bad65 325/372: - ensured all annotations are saved before showing summary window., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6239d033ce 355/372: - updated README.org mentioning 'annotate-y-or-n-prompt-function'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 04a5710cf6 334/372: - prevented saving a file whith an empty database;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 2e7c18b12a 337/372: - fixed callback for "[replace]" button in summary window, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6b73ccf009 352/372: - fixed function's name., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4c3ba3a5da 331/372: - prevented calling 'annotate--remove-annotation-property' on a narrowed buffer, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3b0bc40a4f 347/372: - improved docstrings;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 46aa377cfc 370/372: - upgraded version number;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 0cfad246ee 372/372: Merge pull request #120 from cage2/add-merge-db, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 401a9b4990 309/372: - removed useless argument for 'font-lock-flush'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ed0c9bc64b 184/372: - prevented annotation of text marked with a region that overlap with,
ELPA Syncer <=
- [nongnu] elpa/annotate 24de0e4607 190/372: - renamed and fixed function to search for annotations relative to a, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e6fb2b31df 188/372: - fixed position to start for overlay checks in, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a81a7d9386 209/372: - updated versions;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 30ee7a0b87 198/372: - fixed 'annotate-previous-annotation-ends' and 'annotate-next-annotation-ends', ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 1143087515 213/372: - updated documentation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b8fd76f712 216/372: Merge pull request #60 from cage2/rethink-multiline-annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a37ec08035 249/372: - added signalling of error to 'annotate-switch-db';, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 34f0df8d5b 251/372: - updated documentation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate bc89867f65 289/372: Merge pull request #92 from cage2/expand-db-path, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate be998ca006 263/372: Merge pull request #81 from cage2/popup-annotation, ELPA Syncer, 2022/02/04