[Top][All Lists]

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

[elpa] externals/ebdb e1efb02 8/9: Add before-save-hook and after-save-h

From: Eric Abrahamsen
Subject: [elpa] externals/ebdb e1efb02 8/9: Add before-save-hook and after-save-hook
Date: Tue, 13 Aug 2019 21:46:51 -0400 (EDT)

branch: externals/ebdb
commit e1efb0200ac4cde39de22b8a0694696e9ff58794
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Add before-save-hook and after-save-hook
    * ebdb.el (ebdb-before-save-hook, ebdb-after-save-hook): New hooks, as
    (ebdb-save): Run them.
 ebdb.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/ebdb.el b/ebdb.el
index f7d03e7..9280474 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -359,6 +359,14 @@ anniversary date, and the sexp (as a string):
   :group 'ebdb
   :type 'hook)
+(defcustom ebdb-before-save-hook nil
+  "Hook run before saving all databases."
+  :type 'hook)
+(defcustom ebdb-after-save-hook nil
+  "Hook run after saving all databases."
+  :type 'hook)
 (defvar ebdb-create-hook nil
   "*Hook run each time a new EBDB record is created.
 Run with one argument, the new record.  This is called before the record is
@@ -5179,9 +5187,11 @@ additionally prompt to save each database individually."
   ;; TODO: Reimplement ebdb-remote-file, or otherwise do something
   ;; about that.
   (when interactive
-   (message "Saving the EBDB..."))
+    (message "Saving the EBDB..."))
+  (run-hooks 'ebdb-before-save-hook)
   (dolist (s ebdb-db-list)
     (ebdb-db-save s (eq interactive 4)))
+  (run-hooks 'ebdb-after-save-hook)
   (when interactive
    (message "Saving the EBDB... done")))

reply via email to

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