emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: bookmark.el bug report


From: Drew Adams
Subject: RE: bookmark.el bug report
Date: Mon, 28 Dec 2009 07:58:29 -0800

> (defun bookmark-bmenu-bookmark ()
>   "Return the name of the bookmark on this line."
>   (when (bookmark-bmenu-check-position)
>     (save-excursion
>       (forward-line 0) (forward-char 3)
>       (get-text-property (point) 'bmkext-bookmark-name))))

1. There is no need for the `bookmark-bmenu-check-position' test. All such
pseudotests can be removed - that function always returns non-nil (unless the
`bookmark-alist' is nil).

2. Wrap the `save-excursion' in `ignore-errors' or a `condition-case', for the
`forward-char' at eob. E.g., this is the definition in bookmark+.el:

(defun bookmark-bmenu-bookmark ()
  "Return the name of the bookmark on this line."
  (condition-case nil
      (save-excursion
       (forward-line 0) (forward-char 3)
       (get-text-property (point) 'bookmarkp-bookmark-name))
    (error nil)))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]