[Top][All Lists]

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

bug#14377: 24.3.50; patch: run a hook after `bookmark-write'

From: Eduard Wiebe
Subject: bug#14377: 24.3.50; patch: run a hook after `bookmark-write'
Date: Thu, 09 May 2013 22:22:20 +0200


i want always to export my bookmarks when bookmark file is saved.
Consider this simple patch.
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 482cdf9..ee561db 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1311,6 +1311,9 @@ Don't use this in Lisp programs; use `bookmark-save' 
   (bookmark-save t))

+(defvar bookmark-after-save-hook nil
+  "Hook run after bookmark file was saved.")
 (defun bookmark-save (&optional parg file)
   "Save currently defined bookmarks.
@@ -1380,5 +1383,6 @@ for a file, defaulting to the file defined by variable
             (write-region (point-min) (point-max) file)
           (file-error (message "Can't write %s" file)))
         (kill-buffer (current-buffer))
+        (run-hooks 'bookmark-after-save-hook)
          "Saving bookmarks to file %s...done" file)))))

reply via email to

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