changeset 106701:a3eff1130b76

* lisp/bookmark.el (bookmark-bmenu-marks-width): Define to 1, not 2. (bookmark-bmenu-list, bookmark-bmenu-bookmark): Calculate property positions by using `bookmark-bmenu-marks-width', instead of hardcoding. This fixes the `bookmark-bmenu-execute-deletions' bug reported here: http://lists.gnu.org/archive/html/emacs-devel/2009-12/msg00819.html From: Sun Yijiang <sunyijiang {_AT_} gmail.com> To: emacs-devel {_AT_} gnu.org Subject: bookmark.el bug report Date: Mon, 28 Dec 2009 14:19:16 +0800 Message-ID: 5065e2900912272219y3734fc9fsdaee41167ef99ad7@mail.gmail.com
author Karl Fogel <kfogel@red-bean.com>
date Sat, 02 Jan 2010 00:00:55 -0500
parents dc3fdb0cfdc7
children d4fd57e5eafd
files lisp/ChangeLog lisp/bookmark.el
diffstat 2 files changed, 23 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jan 01 23:36:17 2010 -0500
+++ b/lisp/ChangeLog	Sat Jan 02 00:00:55 2010 -0500
@@ -1,3 +1,17 @@
+2010-01-02  Karl Fogel  <kfogel@red-bean.com>
+
+	* lisp/bookmark.el (bookmark-bmenu-marks-width): Define to 1, not 2.
+	(bookmark-bmenu-list, bookmark-bmenu-bookmark): Calculate property
+	positions by using `bookmark-bmenu-marks-width', instead of hardcoding.
+	This fixes the `bookmark-bmenu-execute-deletions' bug reported here:
+
+	http://lists.gnu.org/archive/html/emacs-devel/2009-12/msg00819.html
+	From: Sun Yijiang <sunyijiang {_AT_} gmail.com>
+	To: emacs-devel {_AT_} gnu.org
+	Subject: bookmark.el bug report
+	Date: Mon, 28 Dec 2009 14:19:16 +0800
+	Message-ID: 5065e2900912272219y3734fc9fsdaee41167ef99ad7@mail.gmail.com
+
 2010-01-02  Karl Fogel  <kfogel@red-bean.com>
 
 	* bookmark.el: Improvements suggested by Drew Adams:
--- a/lisp/bookmark.el	Fri Jan 01 23:36:17 2010 -0500
+++ b/lisp/bookmark.el	Sat Jan 02 00:00:55 2010 -0500
@@ -177,7 +177,7 @@
 (defconst bookmark-bmenu-header-height 2
   "Number of lines used for the *Bookmark List* header.")
 
-(defconst bookmark-bmenu-marks-width 2
+(defconst bookmark-bmenu-marks-width 1
   "Number of columns (chars) used for the *Bookmark List* marks column.")
 
 (defcustom bookmark-bmenu-file-column 30
@@ -1592,10 +1592,12 @@
                     " *" "  ")
                 name)
         (setq end (point))
-        (put-text-property start (+ 2 start) 'bookmark-name-prop name)
+        (put-text-property start
+                           (+ bookmark-bmenu-marks-width 1 start)
+                           'bookmark-name-prop name)
         (when (display-mouse-p)
           (add-text-properties
-           (+ 2 start) end
+           (+ bookmark-bmenu-marks-width 1 start) end
            '(mouse-face highlight
              follow-link t
              help-echo "mouse-2: go to this bookmark in other window")))
@@ -1747,7 +1749,10 @@
 (defun bookmark-bmenu-bookmark ()
   "Return the bookmark for this line in an interactive bookmark list buffer."
   (bookmark-bmenu-ensure-position)
-  (get-text-property (line-beginning-position) 'bookmark-name-prop))
+  (save-excursion
+    (beginning-of-line)
+    (forward-char bookmark-bmenu-marks-width)
+    (get-text-property (point) 'bookmark-name-prop)))
 
 
 (defun bookmark-show-annotation (bookmark)