summaryrefslogtreecommitdiff
path: root/lisp/bookmark.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-04-14 11:07:53 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2010-04-14 11:07:53 -0400
commitebb9641fb29728e9fbba70cb27f2d42679e32de7 (patch)
tree577b464e524ffe81d17774c387febee1ad57b66e /lisp/bookmark.el
parent7b05466ff6721988517519081078b19fffeecd09 (diff)
downloademacs-ebb9641fb29728e9fbba70cb27f2d42679e32de7.tar.gz
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.
Diffstat (limited to 'lisp/bookmark.el')
-rw-r--r--lisp/bookmark.el14
1 files changed, 9 insertions, 5 deletions
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