]> git.eshelyaron.com Git - emacs.git/commitdiff
Add a new field `location' to bookmarks for non-file bookmarks.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 14 Apr 2010 15:07:53 +0000 (11:07 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 14 Apr 2010 15:07:53 +0000 (11:07 -0400)
* 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/ChangeLog
lisp/bookmark.el
lisp/gnus/ChangeLog
lisp/gnus/gnus-sum.el
lisp/man.el
lisp/woman.el

index 89d56ffd32349e6bb75f9ddcc9ac154ee99b90c7..b9e8ea511e654eb20d6da3c3547271551b19f71a 100644 (file)
@@ -1,3 +1,11 @@
+2010-04-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       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): Add `location' field.
+
 2010-04-14  Juri Linkov  <juri@jurta.org>
 
        * simple.el (scroll-error-top-bottom): New defcustom.
index 12ac760580c4560c0ba2ca38e208519401470783..cfc7d7af5c8344bbb618fab76a24d5b4a7486f10 100644 (file)
@@ -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
index 52de639c8138c74bd3b5a0693a18477c0559e951..b0b3cd11b6abd1065da68a16e51112c10c033e67 100644 (file)
@@ -1,3 +1,7 @@
+2010-04-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * gnus-sum.el (gnus-summary-bookmark-make-record): Add `location' field.
+
 2010-04-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * gnus-sum.el: Add bookmark declarations to silence the compiler.
index ba74e3baeb878e19ae173d98bfaf14a452d0c756..d8a36dd77db9f47f34d585e7504068221f244d38 100644 (file)
@@ -12657,8 +12657,9 @@ If ALL is a number, fetch this number of articles."
          (id      (mail-header-id head)))
     `(,subject
       ,@(bookmark-make-record-default 'point-only)
-        (group . ,grp) (article . ,art)
-        (message-id . ,id) (handler . gnus-summary-bookmark-jump))))
+      (location . ,(format "Gnus %s:%d:%s" grp art id))
+      (group . ,grp) (article . ,art)
+      (message-id . ,id) (handler . gnus-summary-bookmark-jump))))
 
 ;;;###autoload
 (defun gnus-summary-bookmark-jump (bookmark)
index 67bdcbea4e61a99f9f5c2cd5f0425f21101ff539..df5f4807cecd3c871d8b0cf9805f222a37a4b395 100644 (file)
@@ -1689,8 +1689,9 @@ Uses `Man-name-local-regexp'."
   "Make a bookmark entry for a Man buffer."
   `(,(Man-default-bookmark-title)
     ,@(bookmark-make-record-default 'point-only)
-      (man-args . ,Man-arguments)
-      (handler . Man-bookmark-jump)))
+    (location . ,(concat "man " Man-arguments))
+    (man-args . ,Man-arguments)
+    (handler . Man-bookmark-jump)))
 
 ;;;###autoload
 (defun Man-bookmark-jump (bookmark)
index 603b7917064647e73b5d6f51f732753adee510c4..fa7ea1836ae21f67dd94cddaf94bbbdbc66a1bfb 100644 (file)
@@ -4533,6 +4533,7 @@ logging the message."
   "Make a bookmark entry for a Woman buffer."
   `(,(Man-default-bookmark-title)
     ,@(bookmark-make-record-default 'point-only)
+    (location . ,(concat "woman " woman-last-file-name))
     ;; Use the same form as man's bookmarks, as much as possible.
     (man-args . ,woman-last-file-name)
     (handler . woman-bookmark-jump)))