diff options
| author | Karl Fogel | 2010-01-02 00:00:55 -0500 |
|---|---|---|
| committer | Karl Fogel | 2010-01-02 00:00:55 -0500 |
| commit | 5ae329f4c86fa4eff1d30d80f82e4d80ff3da81d (patch) | |
| tree | 3e830a9522f86a98245e1b60ab6b7cab2915ee24 | |
| parent | aef053eb79200ade81c9d364db234f484246c11b (diff) | |
| download | emacs-5ae329f4c86fa4eff1d30d80f82e4d80ff3da81d.tar.gz emacs-5ae329f4c86fa4eff1d30d80f82e4d80ff3da81d.zip | |
* 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
| -rw-r--r-- | lisp/ChangeLog | 14 | ||||
| -rw-r--r-- | lisp/bookmark.el | 13 |
2 files changed, 23 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 74b4cc1dbca..4a23bf13396 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,19 @@ | |||
| 1 | 2010-01-02 Karl Fogel <kfogel@red-bean.com> | 1 | 2010-01-02 Karl Fogel <kfogel@red-bean.com> |
| 2 | 2 | ||
| 3 | * lisp/bookmark.el (bookmark-bmenu-marks-width): Define to 1, not 2. | ||
| 4 | (bookmark-bmenu-list, bookmark-bmenu-bookmark): Calculate property | ||
| 5 | positions by using `bookmark-bmenu-marks-width', instead of hardcoding. | ||
| 6 | This fixes the `bookmark-bmenu-execute-deletions' bug reported here: | ||
| 7 | |||
| 8 | http://lists.gnu.org/archive/html/emacs-devel/2009-12/msg00819.html | ||
| 9 | From: Sun Yijiang <sunyijiang {_AT_} gmail.com> | ||
| 10 | To: emacs-devel {_AT_} gnu.org | ||
| 11 | Subject: bookmark.el bug report | ||
| 12 | Date: Mon, 28 Dec 2009 14:19:16 +0800 | ||
| 13 | Message-ID: 5065e2900912272219y3734fc9fsdaee41167ef99ad7@mail.gmail.com | ||
| 14 | |||
| 15 | 2010-01-02 Karl Fogel <kfogel@red-bean.com> | ||
| 16 | |||
| 3 | * bookmark.el: Improvements suggested by Drew Adams: | 17 | * bookmark.el: Improvements suggested by Drew Adams: |
| 4 | (bookmark-bmenu-ensure-position): New name for | 18 | (bookmark-bmenu-ensure-position): New name for |
| 5 | `bookmark-bmenu-check-position'. Just ensure the position, | 19 | `bookmark-bmenu-check-position'. Just ensure the position, |
diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 74d16c16fc6..190ce58689f 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el | |||
| @@ -177,7 +177,7 @@ recently set ones come first, oldest ones come last)." | |||
| 177 | (defconst bookmark-bmenu-header-height 2 | 177 | (defconst bookmark-bmenu-header-height 2 |
| 178 | "Number of lines used for the *Bookmark List* header.") | 178 | "Number of lines used for the *Bookmark List* header.") |
| 179 | 179 | ||
| 180 | (defconst bookmark-bmenu-marks-width 2 | 180 | (defconst bookmark-bmenu-marks-width 1 |
| 181 | "Number of columns (chars) used for the *Bookmark List* marks column.") | 181 | "Number of columns (chars) used for the *Bookmark List* marks column.") |
| 182 | 182 | ||
| 183 | (defcustom bookmark-bmenu-file-column 30 | 183 | (defcustom bookmark-bmenu-file-column 30 |
| @@ -1592,10 +1592,12 @@ deletion, or > if it is flagged for displaying." | |||
| 1592 | " *" " ") | 1592 | " *" " ") |
| 1593 | name) | 1593 | name) |
| 1594 | (setq end (point)) | 1594 | (setq end (point)) |
| 1595 | (put-text-property start (+ 2 start) 'bookmark-name-prop name) | 1595 | (put-text-property start |
| 1596 | (+ bookmark-bmenu-marks-width 1 start) | ||
| 1597 | 'bookmark-name-prop name) | ||
| 1596 | (when (display-mouse-p) | 1598 | (when (display-mouse-p) |
| 1597 | (add-text-properties | 1599 | (add-text-properties |
| 1598 | (+ 2 start) end | 1600 | (+ bookmark-bmenu-marks-width 1 start) end |
| 1599 | '(mouse-face highlight | 1601 | '(mouse-face highlight |
| 1600 | follow-link t | 1602 | follow-link t |
| 1601 | help-echo "mouse-2: go to this bookmark in other window"))) | 1603 | 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." | |||
| 1747 | (defun bookmark-bmenu-bookmark () | 1749 | (defun bookmark-bmenu-bookmark () |
| 1748 | "Return the bookmark for this line in an interactive bookmark list buffer." | 1750 | "Return the bookmark for this line in an interactive bookmark list buffer." |
| 1749 | (bookmark-bmenu-ensure-position) | 1751 | (bookmark-bmenu-ensure-position) |
| 1750 | (get-text-property (line-beginning-position) 'bookmark-name-prop)) | 1752 | (save-excursion |
| 1753 | (beginning-of-line) | ||
| 1754 | (forward-char bookmark-bmenu-marks-width) | ||
| 1755 | (get-text-property (point) 'bookmark-name-prop))) | ||
| 1751 | 1756 | ||
| 1752 | 1757 | ||
| 1753 | (defun bookmark-show-annotation (bookmark) | 1758 | (defun bookmark-show-annotation (bookmark) |