all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eduard Wiebe <usenet@pusto.de>
To: 14377@debbugs.gnu.org
Subject: bug#14377: 24.3.50; patch: run a hook after `bookmark-write'
Date: Thu, 09 May 2013 22:22:20 +0200	[thread overview]
Message-ID: <87fvxv6gzn.fsf@pusto.de> (raw)

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

             reply	other threads:[~2013-05-09 20:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-09 20:22 Eduard Wiebe [this message]
2013-05-10 21:09 ` bug#14377: 24.3.50; patch: run a hook after `bookmark-write' Stefan Monnier
2013-05-11 19:30   ` Eduard Wiebe
2013-05-12  1:42     ` Glenn Morris
2013-05-12 18:01       ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fvxv6gzn.fsf@pusto.de \
    --to=usenet@pusto.de \
    --cc=14377@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.