unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14377: 24.3.50; patch: run a hook after `bookmark-write'
@ 2013-05-09 20:22 Eduard Wiebe
  2013-05-10 21:09 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Eduard Wiebe @ 2013-05-09 20:22 UTC (permalink / raw)
  To: 14377

[-- Attachment #1: Type: text/plain, Size: 107 bytes --]

 
   Hello,

i want always to export my bookmarks when bookmark file is saved.
Consider this simple patch.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bookmark.after.save.hook.patch --]
[-- Type: text/x-diff, Size: 786 bytes --]

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)))))

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-12 18:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-09 20:22 bug#14377: 24.3.50; patch: run a hook after `bookmark-write' Eduard Wiebe
2013-05-10 21:09 ` Stefan Monnier
2013-05-11 19:30   ` Eduard Wiebe
2013-05-12  1:42     ` Glenn Morris
2013-05-12 18:01       ` Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).