[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 4b2fa8f61e 252/372: - removed function 'annotate-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 4b2fa8f61e 252/372: - removed function 'annotate-load-annotation-data-ignore-errors'. |
Date: |
Fri, 4 Feb 2022 16:59:04 -0500 (EST) |
branch: elpa/annotate
commit 4b2fa8f61ef8d5c7d97487d8067f4d88658e9cf2
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- removed function 'annotate-load-annotation-data-ignore-errors'.
Used an optional parameter in 'annotate-load-annotation-data'
to ignore the signalled errors instead.
---
annotate.el | 46 ++++++++++++++++++++++------------------------
1 file changed, 22 insertions(+), 24 deletions(-)
diff --git a/annotate.el b/annotate.el
index 50a55d9018..7d30282789 100644
--- a/annotate.el
+++ b/annotate.el
@@ -1103,7 +1103,7 @@ essentially what you get from:
(= (annotate-beginning-of-annotation
a)
(annotate-ending-of-annotation
a)))
(annotate-describe-annotations)))
- (all-annotations (annotate-load-annotation-data-ignore-errors))
+ (all-annotations (annotate-load-annotation-data t))
(filename (annotate-guess-filename-for-dump
(annotate-actual-file-name))))
(if (assoc-string filename all-annotations)
(setcdr (assoc-string filename all-annotations)
@@ -1128,7 +1128,7 @@ essentially what you get from:
"Load all annotations from disk in old format."
(interactive)
(let ((annotations (cdr (assoc-string (annotate-actual-file-name)
-
(annotate-load-annotation-data-ignore-errors))))
+ (annotate-load-annotation-data t))))
(modified-p (buffer-modified-p)))
;; remove empty annotations created by earlier bug:
(setq annotations (cl-remove-if (lambda (ann) (null (nth 2 ann)))
@@ -1189,7 +1189,7 @@ example:
(not (stringp (cl-first (last annotation))))))
(interactive)
(let* ((filename (annotate-actual-file-name))
- (all-annotations-data (annotate-load-annotation-data-ignore-errors))
+ (all-annotations-data (annotate-load-annotation-data t))
(annotation-dump (assoc-string filename all-annotations-data))
(annotations (annotate-annotations-from-dump
annotation-dump))
(old-checksum (annotate-checksum-from-dump annotation-dump))
@@ -1243,27 +1243,25 @@ i.e. the first record is removed."
"Update database *on disk* removing all the records with empty
annotation."
(interactive)
- (let ((db (annotate-db-clean-records
(annotate-load-annotation-data-ignore-errors))))
+ (let ((db (annotate-db-clean-records (annotate-load-annotation-data t))))
(annotate-dump-annotation-data db)))
-(defun annotate-load-annotation-data-ignore-errors ()
- "Read and return saved annotations, returns nil if an error
-occurs."
- (ignore-errors
- (annotate-load-annotation-data)))
-
-(defun annotate-load-annotation-data ()
+(defun annotate-load-annotation-data (&optional ignore-errors)
"Read and return saved annotations."
- (with-temp-buffer
- (if (file-exists-p annotate-file)
- (insert-file-contents annotate-file)
- (signal 'annotate-db-file-not-found (list annotate-file)))
- (goto-char (point-max))
- (cond ((= (point) 1)
- nil)
- (t
- (goto-char (point-min))
- (read (current-buffer))))))
+ (cl-flet ((%load-annotation-data ()
+ (with-temp-buffer
+ (if (file-exists-p annotate-file)
+ (insert-file-contents annotate-file)
+ (signal 'annotate-db-file-not-found (list annotate-file)))
+ (goto-char (point-max))
+ (cond ((= (point) 1)
+ nil)
+ (t
+ (goto-char (point-min))
+ (read (current-buffer)))))))
+ (if ignore-errors
+ (ignore-errors (%load-annotation-data))
+ (%load-annotation-data))))
(defun annotate-dump-annotation-data (data)
"Save `data` into annotation file."
@@ -1868,7 +1866,7 @@ sophisticated way than plain text"
(ending (button-get button 'ending))
(begin-of-button (button-get button 'begin-of-button))
(end-of-button (button-get button 'end-of-button))
- (db (annotate-load-annotation-data-ignore-errors))
+ (db (annotate-load-annotation-data t))
(filtered (annotate-db-remove-annotation db filename beginning
ending)))
(annotate-dump-annotation-data filtered) ; save the new database with
entry removed
(cl-labels ((redraw-summary-window () ; update the summary window
@@ -1897,7 +1895,7 @@ sophisticated way than plain text"
(annotation-beginning (button-get button 'beginning))
(annotation-ending (button-get button 'ending))
(query (button-get button 'query))
- (db (annotate-load-annotation-data-ignore-errors))
+ (db (annotate-load-annotation-data t))
(old-annotation (button-get button 'text))
(new-annotation-text (read-from-minibuffer
annotate-annotation-prompt old-annotation)))
(when (not (annotate-string-empty-p new-annotation-text))
@@ -2024,7 +2022,7 @@ results can be filtered with a simple query language: see
(t
".*"))))
(let* ((filter-query (get-query))
- (dump (annotate-summary-filter-db
(annotate-load-annotation-data-ignore-errors)
+ (dump (annotate-summary-filter-db
(annotate-load-annotation-data t)
filter-query)))
(if (db-empty-p dump)
(when annotate-use-messages
- [nongnu] elpa/annotate 5e2609e16e 207/372: - optimized 'annotate-previous-annotation-ends' and 'annotate-next-annotation-starts'., (continued)
- [nongnu] elpa/annotate 5e2609e16e 207/372: - optimized 'annotate-previous-annotation-ends' and 'annotate-next-annotation-starts'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 085791450c 215/372: - changed version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate c72e730ba3 217/372: - fixed annotation picking in 'annotate-annotate', ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a38a2ff6b4 221/372: - updated version and documentation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate bb8cda2edc 238/372: - actually changed version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e2fed2fbcf 246/372: - removed useless spaces., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 85520c0202 228/372: - fixed version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3f0c28cab6 241/372: - fixed a bug that allowed to create an annotation with an empty text., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 2050c59af3 227/372: - marked buffer as unmodified when switching database and the only, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 99d99e5bcb 234/372: Merge pull request #72 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4b2fa8f61e 252/372: - removed function 'annotate-load-annotation-data-ignore-errors'.,
ELPA Syncer <=
- [nongnu] elpa/annotate c972641056 258/372: - Using "help-echo" to print annotations instead of render it on the buffer., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9320918b91 270/372: Merge pull request #84 from cage2/fix-regression-multiline-annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3e70e187b3 262/372: - updated NEWS and Changelog., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4af196ce04 312/372: - updated Changelog and NEWS.org., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3a4dc507c2 305/372: - removed unused functions., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3458b548f4 303/372: - removed warning related to misplaced '(interactive)', ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ed5f00d51c 351/372: - increased version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ffd6bbcc11 340/372: - allowed paths with spaces in a search query., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b9c908f24c 365/372: Merge pull request #115 from cage2/fix-delete-ghost-db, ELPA Syncer, 2022/02/04