From: Thierry Volpiatto Date: Thu, 4 Apr 2013 01:59:09 +0000 (-0400) Subject: * lisp/bookmark.el: Fix deletion of bookmarks. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~526^2~11 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2575da508408a178f64c9bcdd51e2e0502419a17;p=emacs.git * lisp/bookmark.el: Fix deletion of bookmarks. (bookmark-bmenu-list): Don't toggle filenames if alist is empty. (bookmark-bmenu-execute-deletions): Only skip first line if it's the header. (bookmark-exit-hook-internal): Save even if list is empty. Fixes: debbugs:13972 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 78015230bab..d1d4d0d6033 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2013-04-04 Thierry Volpiatto + + * bookmark.el: Fix deletion of bookmarks (bug#13972). + (bookmark-bmenu-list): Don't toggle filenames if alist is empty. + (bookmark-bmenu-execute-deletions): Only skip first line if it's + the header. + (bookmark-exit-hook-internal): Save even if list is empty. + 2013-04-04 Yann Hodique (tiny change) * emacs-lisp/package.el (package-pinned-packages): New var. diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 47e13799625..c1d8a4a0a5e 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 \\\\ (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