1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00

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.
This commit is contained in:
Stefan Monnier 2010-04-14 11:07:53 -04:00
parent 7b05466ff6
commit ebb9641fb2
6 changed files with 28 additions and 9 deletions

View 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> 2010-04-14 Juri Linkov <juri@jurta.org>
* simple.el (scroll-error-top-bottom): New defcustom. * simple.el (scroll-error-top-bottom): New defcustom.

View File

@ -1176,9 +1176,7 @@ minibuffer history list `bookmark-history'."
(or no-history (bookmark-maybe-historicize-string bookmark)) (or no-history (bookmark-maybe-historicize-string bookmark))
(let ((start (point))) (let ((start (point)))
(prog1 (prog1
;; FIXME: Each bookmark should come with a `location' method (insert (bookmark-location bookmark))
;; rather than just say "-- no file --".
(insert (or (bookmark-location bookmark) " -- no file --"))
(if (display-mouse-p) (if (display-mouse-p)
(add-text-properties (add-text-properties
start start
@ -1193,10 +1191,16 @@ minibuffer history list `bookmark-history'."
(defalias 'bookmark-locate 'bookmark-insert-location) (defalias 'bookmark-locate 'bookmark-insert-location)
(defun bookmark-location (bookmark) (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 may be a bookmark name (a string) or a bookmark record."
(bookmark-maybe-load-default-file) (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 ;;;###autoload

View 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> 2010-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
* gnus-sum.el: Add bookmark declarations to silence the compiler. * gnus-sum.el: Add bookmark declarations to silence the compiler.

View File

@ -12657,8 +12657,9 @@ If ALL is a number, fetch this number of articles."
(id (mail-header-id head))) (id (mail-header-id head)))
`(,subject `(,subject
,@(bookmark-make-record-default 'point-only) ,@(bookmark-make-record-default 'point-only)
(group . ,grp) (article . ,art) (location . ,(format "Gnus %s:%d:%s" grp art id))
(message-id . ,id) (handler . gnus-summary-bookmark-jump)))) (group . ,grp) (article . ,art)
(message-id . ,id) (handler . gnus-summary-bookmark-jump))))
;;;###autoload ;;;###autoload
(defun gnus-summary-bookmark-jump (bookmark) (defun gnus-summary-bookmark-jump (bookmark)

View File

@ -1689,8 +1689,9 @@ Uses `Man-name-local-regexp'."
"Make a bookmark entry for a Man buffer." "Make a bookmark entry for a Man buffer."
`(,(Man-default-bookmark-title) `(,(Man-default-bookmark-title)
,@(bookmark-make-record-default 'point-only) ,@(bookmark-make-record-default 'point-only)
(man-args . ,Man-arguments) (location . ,(concat "man " Man-arguments))
(handler . Man-bookmark-jump))) (man-args . ,Man-arguments)
(handler . Man-bookmark-jump)))
;;;###autoload ;;;###autoload
(defun Man-bookmark-jump (bookmark) (defun Man-bookmark-jump (bookmark)

View File

@ -4533,6 +4533,7 @@ logging the message."
"Make a bookmark entry for a Woman buffer." "Make a bookmark entry for a Woman buffer."
`(,(Man-default-bookmark-title) `(,(Man-default-bookmark-title)
,@(bookmark-make-record-default 'point-only) ,@(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. ;; Use the same form as man's bookmarks, as much as possible.
(man-args . ,woman-last-file-name) (man-args . ,woman-last-file-name)
(handler . woman-bookmark-jump))) (handler . woman-bookmark-jump)))