From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#13972: 24.3.50; Cannot delete bookmark Date: Sun, 17 Mar 2013 08:47:13 +0100 Organization: Emacs Helm Message-ID: <87wqt6jwn2.fsf@gmail.com> References: <20130316095317.5cbb9ca32c1e10207221f0b4@gmail.com> <878v5mil9q.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1363506520 10707 80.91.229.3 (17 Mar 2013 07:48:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Mar 2013 07:48:40 +0000 (UTC) To: 13972@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 17 08:49:05 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UH8L3-0003Rm-5D for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Mar 2013 08:49:05 +0100 Original-Received: from localhost ([::1]:41748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH8Kg-0005Ya-DY for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Mar 2013 03:48:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH8Kc-0005Th-78 for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2013 03:48:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UH8Ka-0002xO-E8 for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2013 03:48:38 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH8Ka-0002xK-B4 for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2013 03:48:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UH8Ly-0001tx-HK for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2013 03:50:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <20130316095317.5cbb9ca32c1e10207221f0b4@gmail.com> Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Mar 2013 07:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13972 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13635065627149 (code B ref -1); Sun, 17 Mar 2013 07:50:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Mar 2013 07:49:22 +0000 Original-Received: from localhost ([127.0.0.1]:58441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UH8LJ-0001rD-Q6 for submit@debbugs.gnu.org; Sun, 17 Mar 2013 03:49:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42886) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UH8LG-0001qd-MX for submit@debbugs.gnu.org; Sun, 17 Mar 2013 03:49:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UH8Jk-0002qw-Hx for submit@debbugs.gnu.org; Sun, 17 Mar 2013 03:47:46 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:51315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH8Jk-0002qr-D7 for submit@debbugs.gnu.org; Sun, 17 Mar 2013 03:47:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH8Ji-0004yR-Fd for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2013 03:47:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UH8JW-0002nn-Lv for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2013 03:47:42 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:44028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH8JW-0002nb-BV for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2013 03:47:30 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UH8Jp-0002OC-QA for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2013 08:47:49 +0100 Original-Received: from lbe83-2-78-243-104-167.fbx.proxad.net ([78.243.104.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Mar 2013 08:47:49 +0100 Original-Received: from thierry.volpiatto by lbe83-2-78-243-104-167.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Mar 2013 08:47:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 83 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lbe83-2-78-243-104-167.fbx.proxad.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:0kAsNlyeFXtoSC7QwNSTeDMIqSE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72622 Archived-At: Thierry Volpiatto writes: > Xue Fuqiao 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 \\\\ (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