branch: elpa/annotate commit 8481eaf0c23a1074468c9d6f14a5df22de3bda16 Author: cage <cage-invalid@invalid> Commit: cage <cage-invalid@invalid>
- signalled an error when annotating a region and it overlaps with an existing annotation. --- annotate.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/annotate.el b/annotate.el index 7ffbdee270..9da366cc1e 100644 --- a/annotate.el +++ b/annotate.el @@ -259,6 +259,10 @@ annotation as defined in the database." "Annotations database file not found" 'annotate-error) +(define-error 'annotate-annotate-region-overlaps + "Error: the region overlaps with at least an already existing annotation" + 'annotate-error) + (defun annotate-annotations-exist-p () "Does this buffer contains at least one or more annotations?" (cl-find-if 'annotationp @@ -418,7 +422,7 @@ modified (for example a newline is inserted)." (overlays-in (region-beginning) (region-end))))) (if annotations - (message "Error: the region overlaps with at least an already existing annotation") + (signal 'annotate-annotate-region-overlaps annotations) (create-new-annotation)))) (annotation (annotate-change-annotation (point))