Subject: bug#15746: closed (Fix committed to master.)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 08 Nov 2015 19:28:02 +0000

Your bug report

#15746: 24.3; [PATCH] bookmark should confirm when overwrite

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
15746: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15746
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Fix committed to master.
From: Karl Fogel <[email-masked]>
To: [email-masked]
Date: Sun, 08 Nov 2015 14:27:33 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

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.

Subject: 24.3; [PATCH] bookmark should confirm when overwrite
From: Leo Liu <[email-masked]>
To: [email-masked]
Date: Tue, 29 Oct 2013 11:32:58 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

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