GNU bug report logs - #15746
24.3; [PATCH] bookmark should confirm when overwrite

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Tue, 29 Oct 2013 03:34:02 UTC

Severity: minor

Tags: patch

Found in version 24.3

Done: Karl Fogel <kfogel <at> red-bean.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Leo Liu <sdl.web <at> gmail.com>
Subject: bug#15746: closed (Fix committed to master.)
Date: Sun, 08 Nov 2015 19:28:02 +0000
[Message part 1 (text/plain, inline)]
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 15746 <at> debbugs.gnu.org.

-- 
15746: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15746
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Karl Fogel <kfogel <at> red-bean.com>
To: 15746-done <at> debbugs.gnu.org
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.

[Message part 3 (message/rfc822, inline)]
From: Leo Liu <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
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




This bug report was last modified 9 years and 199 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.