summaryrefslogtreecommitdiff
path: root/lisp/woman.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2010-04-12 11:17:29 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2010-04-12 11:17:29 -0400
commit45be326afc57551050f71b07cb40752a8dfa2aa3 (patch)
treeb00795acf1ffb50b5e8730a8c111bdd7e962961b /lisp/woman.el
parent4794a58232a4a31d628ac6a145dd1113c0ade6fd (diff)
downloademacs-45be326afc57551050f71b07cb40752a8dfa2aa3.tar.gz
Summary: Add bookmark support for man, woman and gnus-summary.
* woman.el (woman-bookmark-make-record, woman-bookmark-jump): New functions. (woman-mode): Setup bookmark support. * man.el (man-set-default-bookmark-title, man-bookmark-make-record) (man-bookmark-jump): New functions. (Man-mode): Setup bookmark support. * gnus-sum.el (gnus-summary-bookmark-make-record) (gnus-summary-bookmark-jump): New functions. (gnus-summary-mode): Setup bookmark support.
Diffstat (limited to 'lisp/woman.el')
-rw-r--r--lisp/woman.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/woman.el b/lisp/woman.el
index 79d6d84aff1..97d65e422de 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -1934,6 +1934,9 @@ See `Man-mode' for additional details."
;; `make-local-variable' in case imenu not yet loaded!
woman-imenu-generic-expression)
(set (make-local-variable 'imenu-space-replacement) " ")
+ ;; Bookmark support.
+ (set (make-local-variable 'bookmark-make-record-function)
+ 'woman-bookmark-make-record)
;; For reformat ...
;; necessary when reformatting a file in its old buffer:
(setq imenu--last-menubar-index-alist nil)
@@ -4516,6 +4519,24 @@ logging the message."
(recenter 0))))))))
nil) ; for woman-file-readable-p etc.
+;;; Bookmark Woman support.
+
+(defun woman-bookmark-make-record ()
+ "Make a bookmark entry for a Woman buffer."
+ `(,(man-set-default-bookmark-title)
+ ,@(bookmark-make-record-default 'point-only)
+ (filename . ,woman-last-file-name)
+ (handler . woman-bookmark-jump)))
+
+
+(defun woman-bookmark-jump (bookmark)
+ "Default bookmark handler for Woman buffers."
+ (let* ((file (bookmark-prop-get bookmark 'filename))
+ (buf (save-window-excursion
+ (woman-find-file file) (current-buffer))))
+ (bookmark-default-handler
+ `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark)))))
+
(provide 'woman)
;; arch-tag: eea35e90-552f-4712-a94b-d9ffd3db7651