all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15746: 24.3; [PATCH] bookmark should confirm when overwrite
@ 2013-10-29  3:32 Leo Liu
  2013-10-29 14:20 ` Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Leo Liu @ 2013-10-29  3:32 UTC (permalink / raw)
  To: 15746; +Cc: Karl Fogel

Occationally I have overwritten bookmarks with regrets. So maybe
something along the following lines is needed.

=== modified file 'lisp/bookmark.el'
--- lisp/bookmark.el	2013-09-11 03:31:56 +0000
+++ lisp/bookmark.el	2013-10-29 03:27:15 +0000
@@ -811,6 +811,12 @@
                      bookmark-minibuffer-read-name-map
                      nil nil defaults))))
            (and (string-equal str "") (setq str default))
+           (when (and (not no-overwrite)
+                      (bookmark-get-bookmark str)
+                      (called-interactively-p 'interactive)
+                      (not (yes-or-no-p
+                            (format "Bookmark `%s' exists; overwrite? " str))))
+             (user-error "Aborted"))
            (bookmark-store str (cdr record) no-overwrite)
 
            ;; Ask for an annotation buffer for this bookmark






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

end of thread, other threads:[~2015-11-08 19:27 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-29  3:32 bug#15746: 24.3; [PATCH] bookmark should confirm when overwrite Leo Liu
2013-10-29 14:20 ` Drew Adams
2013-10-29 18:24 ` Karl Fogel
2013-10-29 20:09   ` Drew Adams
2013-10-29 20:51     ` Karl Fogel
2013-10-29 22:16       ` Drew Adams
2013-10-30  4:31         ` Karl Fogel
2013-10-30 14:07           ` Drew Adams
2013-10-30  2:11     ` Stefan Monnier
2013-10-30  2:35       ` Drew Adams
2013-10-30  2:56       ` Leo Liu
2013-10-30  3:14         ` Stefan Monnier
2013-10-30  3:36           ` Leo Liu
2013-10-30  3:57             ` Stefan Monnier
2013-10-30 14:07           ` Drew Adams
2013-10-30 18:17             ` Stefan Monnier
2013-10-30  1:28   ` Leo Liu
2013-10-30  2:26   ` Drew Adams
2015-11-08 19:27 ` bug#15746: Fix committed to master Karl Fogel

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.