diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-03-09 21:37:16 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-03-09 21:37:16 +0000 |
commit | a9f8b49b44a4083d8e5a2429306ce41e7f3cfe0e (patch) | |
tree | 9d973b799c1d741f9bbdb3fa73d97564ed99fb1d /lisp | |
parent | 136894c8fc052b51d5558c169881d92086158e8e (diff) | |
download | emacs-a9f8b49b44a4083d8e5a2429306ce41e7f3cfe0e.tar.gz emacs-a9f8b49b44a4083d8e5a2429306ce41e7f3cfe0e.tar.bz2 emacs-a9f8b49b44a4083d8e5a2429306ce41e7f3cfe0e.zip |
(bookmark-buffer-file-name, bookmark-prop-get): Declare.
(doc-view-bookmark-make-record): Use them.
(doc-view-bookmark-jump): Use them. Fix find-file -> find-file-noselect.
(bookmark-get-filename, bookmark-get-bookmark-record): Remove.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/doc-view.el | 20 |
2 files changed, 16 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7d194ed5300..bb2291dc3e9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2008-03-09 Stefan Monnier <monnier@iro.umontreal.ca> + * doc-view.el (bookmark-buffer-file-name, bookmark-prop-get): Declare. + (doc-view-bookmark-make-record): Use them. + (doc-view-bookmark-jump): Use them. Fix find-file -> find-file-noselect. + (bookmark-get-filename, bookmark-get-bookmark-record): Remove. + * bookmark.el (bookmark-make-record-function): Change expected return value to include a suggested bookmark name. (bookmark-make): Split into bookmark-make-record and bookmark-store. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 43d06f3c077..bb98b4a8af1 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1082,26 +1082,28 @@ See the command `doc-view-mode' for more information on this mode." ;;;; Bookmark integration +(declare-function bookmark-buffer-file-name "bookmark" ()) +(declare-function bookmark-prop-get "bookmark" (bookmark prop)) + (defun doc-view-bookmark-make-record () - `((filename . ,buffer-file-name) + `((filename . ,(bookmark-buffer-file-name)) (page . ,(doc-view-current-page)) (handler . doc-view-bookmark-jump))) -(declare-function bookmark-get-filename "bookmark" (bookmark)) -(declare-function bookmark-get-bookmark-record "bookmark" (bookmark)) - ;;;###autoload (defun doc-view-bookmark-jump (bmk) ;; This implements the `handler' function interface for record type ;; returned by `doc-view-bookmark-make-record', which see. - (save-window-excursion - (let ((filename (bookmark-get-filename bmk)) - (page (cdr (assq 'page (bookmark-get-bookmark-record bmk))))) - (find-file filename) + (let ((filename (bookmark-prop-get bmk 'filename)) + (page (bookmark-prop-get bmk 'page))) + (with-current-buffer (find-file-noselect filename) (when (not (eq major-mode 'doc-view-mode)) (doc-view-toggle-display)) - (doc-view-goto-page page) + (with-selected-window + (or (get-buffer-window (current-buffer) 0) + (selected-window)) + (doc-view-goto-page page)) `((buffer ,(current-buffer)) (position ,1))))) |