--- Begin Message ---
Subject: |
24.3; [PATCH] bookmark should confirm when overwrite |
Date: |
Tue, 29 Oct 2013 11:32:58 +0800 |
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
--- End Message ---
--- Begin Message ---
Subject: |
Fix committed to master. |
Date: |
Sun, 08 Nov 2015 14:27:33 -0500 |
I've pushed a fix to master for this (commit 3812e17978).
Essentially it takes Drew's suggestion. I left "C-x r m" as `bookmark-set',
with the same behavior it has now, and "C-x r M" sets a bookmark but errors if
it would overwrite an existing bookmark of the same name.
I didn't go with Stefan's suggestion of using RET RET instead of RET, because
you can't habituate to it. You don't necessarily know in advance whether
you're setting a new bookmark or updating an existing bookmark, so you can't
predict whether you will need to hit RET or RET RET. Better to offer two
different commands, and those people who want one style all the time can just
use the appropriate command all the time.
Comments and further discussion welcome, of course. Thanks, Leo, for raising
this issue, and thanks Drew and Stefan for helping think things through in the
bug ticket.
--- End Message ---