[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 07c015b2ad 1/6: - modified the function called wh
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 07c015b2ad 1/6: - modified the function called when kill-emacs-hook runs |
Date: |
Tue, 9 Aug 2022 04:58:29 -0400 (EDT) |
branch: elpa/annotate
commit 07c015b2ad2278b74171e187317e664a80281f02
Author: cage <cage@invalid>
Commit: cage <cage@invalid>
- modified the function called when kill-emacs-hook runs
The new function ensures all the buffer where annotate-mode is
active save the annotationos in the database; also this function is
registered in the global hooks list.
---
annotate.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/annotate.el b/annotate.el
index c340359cb5..7d418f9a10 100644
--- a/annotate.el
+++ b/annotate.el
@@ -469,7 +469,7 @@ local version (i.e. a different database for each annotated
file"
(annotate--maybe-database-set-buffer-local)
(annotate-load-annotations)
(add-hook 'kill-buffer-hook #'annotate-save-annotations t t)
- (add-hook 'kill-emacs-hook #'annotate-save-annotations t t)
+ (add-hook 'kill-emacs-hook
#'annotate-save-all-annotated-buffers t nil)
;; This hook is needed to reorganize the layout of the annotation
;; text when a window vertically resized
(add-hook 'window-size-change-functions #'on-window-size-change t t)
@@ -488,7 +488,7 @@ local version (i.e. a different database for each annotated
file"
"Clear annotations and remove save and display hooks."
(annotate-clear-annotations)
(remove-hook 'kill-buffer-hook #'annotate-save-annotations t)
- (remove-hook 'kill-emacs-hook #'annotate-save-annotations t)
+ (remove-hook 'kill-emacs-hook
#'annotate-save-all-annotated-buffers nil)
(remove-hook 'window-size-change-functions #'on-window-size-change t)
(remove-hook 'before-change-functions #'annotate-before-change-fn t)
(remove-hook 'Info-selection-hook #'annotate-info-select-fn t)
@@ -1431,6 +1431,13 @@ essentially what you get from:
(and (> (length annotation) 3)
(nth 3 annotation)))
+(defun annotate-save-all-annotated-buffers ()
+ "Save the annotations for all buffer where annotate-mode is active"
+ (let ((all-annotated-buffers (annotate-buffers-annotate-mode )))
+ (cl-loop for annotated-buffer in all-annotated-buffers do
+ (with-current-buffer annotated-buffer
+ (annotate-save-annotations)))))
+
(defun annotate-save-annotations ()
"Save all annotations to disk."
(interactive)
- [nongnu] elpa/annotate updated (4c697e70e8 -> 0f4ffd5c1c), ELPA Syncer, 2022/08/09
- [nongnu] elpa/annotate 07c015b2ad 1/6: - modified the function called when kill-emacs-hook runs,
ELPA Syncer <=
- [nongnu] elpa/annotate 7aadf4b983 2/6: - increased version number., ELPA Syncer, 2022/08/09
- [nongnu] elpa/annotate 8518836bfc 3/6: - updated NEWS.org., ELPA Syncer, 2022/08/09
- [nongnu] elpa/annotate 553662a181 5/6: - removed withespace., ELPA Syncer, 2022/08/09
- [nongnu] elpa/annotate 7975dcac7a 4/6: - updated changelog., ELPA Syncer, 2022/08/09
- [nongnu] elpa/annotate 0f4ffd5c1c 6/6: Merge pull request #133 from cage2/fix-run-hook-when-emacs-killed, ELPA Syncer, 2022/08/09