comparison lisp/woman.el @ 107837:4ad129f7804d

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.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 12 Apr 2010 11:17:29 -0400
parents 41f05dc44793
children f50f5478ec53
comparison
equal deleted inserted replaced
107836:c97553977f7d 107837:4ad129f7804d
1932 ;; Imenu support: 1932 ;; Imenu support:
1933 (set (make-local-variable 'imenu-generic-expression) 1933 (set (make-local-variable 'imenu-generic-expression)
1934 ;; `make-local-variable' in case imenu not yet loaded! 1934 ;; `make-local-variable' in case imenu not yet loaded!
1935 woman-imenu-generic-expression) 1935 woman-imenu-generic-expression)
1936 (set (make-local-variable 'imenu-space-replacement) " ") 1936 (set (make-local-variable 'imenu-space-replacement) " ")
1937 ;; Bookmark support.
1938 (set (make-local-variable 'bookmark-make-record-function)
1939 'woman-bookmark-make-record)
1937 ;; For reformat ... 1940 ;; For reformat ...
1938 ;; necessary when reformatting a file in its old buffer: 1941 ;; necessary when reformatting a file in its old buffer:
1939 (setq imenu--last-menubar-index-alist nil) 1942 (setq imenu--last-menubar-index-alist nil)
1940 ;; necessary to avoid re-installing the same imenu: 1943 ;; necessary to avoid re-installing the same imenu:
1941 (setq woman-imenu-done nil) 1944 (setq woman-imenu-done nil)
4514 (goto-char WoMan-Log-header-point-max) 4517 (goto-char WoMan-Log-header-point-max)
4515 (forward-line -1) 4518 (forward-line -1)
4516 (recenter 0)))))))) 4519 (recenter 0))))))))
4517 nil) ; for woman-file-readable-p etc. 4520 nil) ; for woman-file-readable-p etc.
4518 4521
4522 ;;; Bookmark Woman support.
4523
4524 (defun woman-bookmark-make-record ()
4525 "Make a bookmark entry for a Woman buffer."
4526 `(,(man-set-default-bookmark-title)
4527 ,@(bookmark-make-record-default 'point-only)
4528 (filename . ,woman-last-file-name)
4529 (handler . woman-bookmark-jump)))
4530
4531
4532 (defun woman-bookmark-jump (bookmark)
4533 "Default bookmark handler for Woman buffers."
4534 (let* ((file (bookmark-prop-get bookmark 'filename))
4535 (buf (save-window-excursion
4536 (woman-find-file file) (current-buffer))))
4537 (bookmark-default-handler
4538 `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark)))))
4539
4519 (provide 'woman) 4540 (provide 'woman)
4520 4541
4521 ;; arch-tag: eea35e90-552f-4712-a94b-d9ffd3db7651 4542 ;; arch-tag: eea35e90-552f-4712-a94b-d9ffd3db7651
4522 ;;; woman.el ends here 4543 ;;; woman.el ends here