emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/annotate 2687e123cd 243/372: - added signalling 'annotate-


From: ELPA Syncer
Subject: [nongnu] elpa/annotate 2687e123cd 243/372: - added signalling 'annotate-load-annotation-data' to:
Date: Fri, 4 Feb 2022 16:59:04 -0500 (EST)

branch: elpa/annotate
commit 2687e123cdb740573980c88387c34977b5e7f209
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>

    - added      signalling       'annotate-load-annotation-data'      to:
      'annotate-load-annotation-data'.
---
 annotate.el | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/annotate.el b/annotate.el
index 899628a9d8..b24c89dff1 100644
--- a/annotate.el
+++ b/annotate.el
@@ -247,9 +247,17 @@ annotation as defined in the database."
 (defconst annotate-summary-replace-button-label "[replace]"
   "The label for the button, in summary window, to replace an annotation")
 
+;;;; custom errors
+
 (define-error 'annotate-error "Annotation error")
 
-(define-error 'annotate-empty-annotation-text-error "Empty annotation text" 
'annotate-error)
+(define-error 'annotate-empty-annotation-text-error
+  "Empty annotation text"
+  'annotate-error)
+
+(define-error 'annotate-db-file-not-found
+  "Annotations database file not found"
+  'annotate-error)
 
 (defun annotate-annotations-exist-p ()
   "Does this buffer contains at least one or more annotations?"
@@ -1233,8 +1241,9 @@ annotation."
 (defun annotate-load-annotation-data ()
   "Read and return saved annotations."
   (with-temp-buffer
-    (when (file-exists-p annotate-file)
-      (insert-file-contents annotate-file))
+    (if (file-exists-p annotate-file)
+        (insert-file-contents annotate-file)
+      (signal 'annotate-db-file-not-found annotate-file))
     (goto-char (point-max))
     (cond ((= (point) 1)
            nil)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]