diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-04-12 12:09:47 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-04-12 12:09:47 -0400 |
commit | 398a825b8d994882672906103f330ad8662d1ed6 (patch) | |
tree | e8bc65e0c23632b8e2909d89f51b20dd095a05e2 /lisp/woman.el | |
parent | 45be326afc57551050f71b07cb40752a8dfa2aa3 (diff) | |
download | emacs-398a825b8d994882672906103f330ad8662d1ed6.tar.gz emacs-398a825b8d994882672906103f330ad8662d1ed6.tar.bz2 emacs-398a825b8d994882672906103f330ad8662d1ed6.zip |
Clean up last bookmark changes for man/woman/gnus-summary.
* gnus-sum.el: Add bookmark declarations to silence the compiler.
(gnus-mark-xrefs-as-read, gnus-summary-limit-to-bodies):
Use with-current-buffer to silence the byte-compiler.
(gnus-summary-bookmark-make-record): Use derived-mode-p and don't
bother to require `gnus'.
(gnus-summary-bookmark-jump): Don't forget to autoload. Simplify.
* woman.el: Add bookmark declarations to silence the compiler.
(bookmark-prop-get): Use `man-args' rather than `filename' as a first
step to compatibility between man and woman bookmarks.
Adjust for Man-default-bookmark-title renaming.
(woman-bookmark-jump): Adjust accordingly. Don't forget to autoload.
* man.el: Add bookmark declarations to silence the compiler.
(Man-name-local-regexp): Make it match NAME as well.
(Man-getpage-in-background): Return the buffer.
(Man-notify-when-ready): Use `case'.
(man-set-default-bookmark-title): Rename to Man-default-bookmark-title.
Don't hardcode "NAME". Simplify.
(Man-bookmark-make-record): Use Man-arguments rather than buffer-name.
Rename from Man-bookmark-make-record.
(Man-bookmark-jump): Rename from man-bookmark-jump. Simplify now that
we have the actual man-args. Use Man-getpage-in-background rather
than `man' since the arg is already processed. Let bookmark.el do the
window handling. Only wait for the relevant process.
Don't forget to autoload.
* bookmark.el (bookmark-default-file): Use locate-user-emacs-file.
Diffstat (limited to 'lisp/woman.el')
-rw-r--r-- | lisp/woman.el | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lisp/woman.el b/lisp/woman.el index 97d65e422de..603b7917064 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1897,6 +1897,7 @@ Argument EVENT is the invoking mouse event." (setq woman-emulation value) (woman-reformat-last-file)) +(defvar bookmark-make-record-function) (put 'woman-mode 'mode-class 'special) (defun woman-mode () @@ -4520,18 +4521,29 @@ logging the message." nil) ; for woman-file-readable-p etc. ;;; Bookmark Woman support. +(declare-function bookmark-make-record-default "bookmark" (&optional pos-only)) +(declare-function bookmark-prop-get "bookmark" (bookmark prop)) +(declare-function bookmark-default-handler "bookmark" (bmk)) +(declare-function bookmark-get-bookmark-record "bookmark" (bmk)) + +;; FIXME: woman.el and man.el should be better integrated so, for +;; example, bookmarks of one can be used with the other. (defun woman-bookmark-make-record () "Make a bookmark entry for a Woman buffer." - `(,(man-set-default-bookmark-title) + `(,(Man-default-bookmark-title) ,@(bookmark-make-record-default 'point-only) - (filename . ,woman-last-file-name) - (handler . woman-bookmark-jump))) - + ;; Use the same form as man's bookmarks, as much as possible. + (man-args . ,woman-last-file-name) + (handler . woman-bookmark-jump))) +;;;###autoload (defun woman-bookmark-jump (bookmark) "Default bookmark handler for Woman buffers." - (let* ((file (bookmark-prop-get bookmark 'filename)) + (let* ((file (bookmark-prop-get bookmark 'man-args)) + ;; FIXME: we need woman-find-file-noselect, since + ;; save-window-excursion can't protect us from the case where + ;; woman-find-file creates a new frame. (buf (save-window-excursion (woman-find-file file) (current-buffer)))) (bookmark-default-handler |