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: Leo Liu <sdl.web <at> gmail.com>
To: 15746 <at> debbugs.gnu.org
Cc: Karl Fogel <kfogel <at> red-bean.com>
Subject: bug#15746: 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 253 days ago.

Previous Next


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