]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/bookmark.el (bookmark-bmenu-marks-width): Define to 1, not 2.
authorKarl Fogel <kfogel@red-bean.com>
Sat, 2 Jan 2010 05:00:55 +0000 (00:00 -0500)
committerKarl Fogel <kfogel@red-bean.com>
Sat, 2 Jan 2010 05:00:55 +0000 (00:00 -0500)
  (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

lisp/ChangeLog
lisp/bookmark.el

index 74b4cc1dbca88359d024e2ef8ca221b51331d7fe..4a23bf13396ccd53d1d82a81722bbfb1c372a712 100644 (file)
@@ -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:
index 74d16c16fc6cd94276b2b983032c17671609f63e..190ce58689f3762ad4fb83a23ddc8239068727fc 100644 (file)
@@ -177,7 +177,7 @@ recently set ones come first, oldest ones come last)."
 (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 @@ deletion, or > if it is flagged for displaying."
                     " *" "  ")
                 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 @@ last full line, move to the last full line.  The return value is undefined."
 (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)