From ebb9641fb29728e9fbba70cb27f2d42679e32de7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 14 Apr 2010 11:07:53 -0400 Subject: Add a new field `location' to bookmarks for non-file bookmarks. * bookmark.el (bookmark-location): Use the new field, if present. (bookmark-insert-location): Undo last change, not needed any more. * man.el (Man-bookmark-make-record): * woman.el (woman-bookmark-make-record): * gnus-sum.el (gnus-summary-bookmark-make-record): Add `location' field. --- lisp/bookmark.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lisp/bookmark.el') diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 12ac760580c..cfc7d7af5c8 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1176,9 +1176,7 @@ minibuffer history list `bookmark-history'." (or no-history (bookmark-maybe-historicize-string bookmark)) (let ((start (point))) (prog1 - ;; FIXME: Each bookmark should come with a `location' method - ;; rather than just say "-- no file --". - (insert (or (bookmark-location bookmark) " -- no file --")) + (insert (bookmark-location bookmark)) (if (display-mouse-p) (add-text-properties start @@ -1193,10 +1191,16 @@ minibuffer history list `bookmark-history'." (defalias 'bookmark-locate 'bookmark-insert-location) (defun bookmark-location (bookmark) - "Return the name of the file associated with BOOKMARK, or nil if none. + "Return a description of the location of BOOKMARK. BOOKMARK may be a bookmark name (a string) or a bookmark record." (bookmark-maybe-load-default-file) - (bookmark-get-filename bookmark)) + ;; We could call the `handler' and ask for it to construct a description + ;; dynamically: it would open up several new possibilities, but it + ;; would have the major disadvantage of forcing to load each and + ;; every handler when the user calls bookmark-menu. + (or (bookmark-prop-get bookmark 'location) + (bookmark-get-filename bookmark) + "-- Unknown location --")) ;;;###autoload -- cgit v1.2.1