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

Previous Next

Package: emacs;

Reported by: Eduard Wiebe <usenet <at> pusto.de>

Date: Thu, 9 May 2013 20:33:01 UTC

Severity: wishlist

Tags: patch

Found in version 24.3.50

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Eduard Wiebe <usenet <at> pusto.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; patch: run a hook after `bookmark-write'
Date: Thu, 09 May 2013 22:22:20 +0200
[Message part 1 (text/plain, inline)]
 
   Hello,

i want always to export my bookmarks when bookmark file is saved.
Consider this simple patch.
[bookmark.after.save.hook.patch (text/x-diff, inline)]
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' instead."
   (bookmark-save t))


+(defvar bookmark-after-save-hook nil
+  "Hook run after bookmark file was saved.")
+
 ;;;###autoload
 (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)
         (bookmark-maybe-message
          "Saving bookmarks to file %s...done" file)))))

This bug report was last modified 12 years and 15 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.