unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: 13972@debbugs.gnu.org
Subject: bug#13972: 24.3.50; Cannot delete bookmark
Date: Sun, 17 Mar 2013 08:47:13 +0100	[thread overview]
Message-ID: <87wqt6jwn2.fsf@gmail.com> (raw)
In-Reply-To: <20130316095317.5cbb9ca32c1e10207221f0b4@gmail.com>

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> Xue Fuqiao <xfq.free@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 






  reply	other threads:[~2013-03-17  7:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-16  1:53 bug#13972: 24.3.50; Cannot delete bookmark Xue Fuqiao
2013-03-17  6:38 ` Thierry Volpiatto
2013-03-17  7:47   ` Thierry Volpiatto [this message]
2013-03-18 11:20     ` Thierry Volpiatto
2013-04-01 15:55       ` Thierry Volpiatto
2013-04-04  1:59     ` Stefan Monnier
2013-04-04  5:20       ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wqt6jwn2.fsf@gmail.com \
    --to=thierry.volpiatto@gmail.com \
    --cc=13972@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).