GNU bug report logs -
#13972
24.3.50; Cannot delete bookmark
Previous Next
Reported by: Xue Fuqiao <xfq.free <at> gmail.com>
Date: Sat, 16 Mar 2013 01:55:01 UTC
Severity: normal
Found in version 24.3.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):
Thierry Volpiatto <thierry.volpiatto <at> gmail.com> writes:
> Xue Fuqiao <xfq.free <at> gmail.com> writes:
>
>> I have three bookmarks:
>>
>> TODO /usr/local/share/emacs/24.3.50/etc/TODO
>> startup.el ~/emacs-bzr/trunk/lisp/startup.el
>> text property /usr/local/share/info/elisp
>>
>> All of these files exist. To reproduce this bug:
>>
>> emacs -Q
>> C-x r l
>> d x
>>
>> The echo area says: "Deleting bookmarks...done".
>>
>> But the bookmark isn't deleted. I have attached my
>> ~/.emacs.d/bookmarks.
>
> diff --git a/lisp/bookmark.el b/lisp/bookmark.el
> index 47e1379..ee6e050 100644
> --- a/lisp/bookmark.el
> +++ b/lisp/bookmark.el
> @@ -1582,8 +1582,8 @@ deletion, or > if it is flagged for displaying."
> (if bookmark-bmenu-use-header-line
> (bookmark-bmenu-set-header)
> (forward-line bookmark-bmenu-inline-header-height))
> - (if bookmark-bmenu-toggle-filenames
> - (bookmark-bmenu-toggle-filenames t))))
> + (when (and bookmark-alist bookmark-bmenu-toggle-filenames)
> + (bookmark-bmenu-toggle-filenames t))))
>
> ;;;###autoload
> (defalias 'list-bookmarks 'bookmark-bmenu-list)
And here final patch that delete also the first bookmark in list.
(When forward-line 1, the first bookmark is never deleted because search
start to next bookmark with new header stuff.)
Also the final hook will not save bookmark-alist if empty, I have
removed the check of bookmark-alist.
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 47e1379..c1d8a4a 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1582,8 +1582,8 @@ deletion, or > if it is flagged for displaying."
(if bookmark-bmenu-use-header-line
(bookmark-bmenu-set-header)
(forward-line bookmark-bmenu-inline-header-height))
- (if bookmark-bmenu-toggle-filenames
- (bookmark-bmenu-toggle-filenames t))))
+ (when (and bookmark-alist bookmark-bmenu-toggle-filenames)
+ (bookmark-bmenu-toggle-filenames t))))
;;;###autoload
(defalias 'list-bookmarks 'bookmark-bmenu-list)
@@ -1998,7 +1998,8 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\
(progn (end-of-line) (point))))))
(o-col (current-column)))
(goto-char (point-min))
- (forward-line 1)
+ (unless bookmark-bmenu-use-header-line
+ (forward-line 1))
(while (re-search-forward "^D" (point-max) t)
(bookmark-delete (bookmark-bmenu-bookmark) t)) ; pass BATCH arg
(bookmark-bmenu-list)
@@ -2186,8 +2187,7 @@ strings returned are not."
"Save bookmark state, if necessary, at Emacs exit time.
This also runs `bookmark-exit-hook'."
(run-hooks 'bookmark-exit-hook)
- (and bookmark-alist
- (bookmark-time-to-save-p t)
+ (and (bookmark-time-to-save-p t)
(bookmark-save)))
(unless noninteractive
--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
This bug report was last modified 12 years and 46 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.