summaryrefslogtreecommitdiff
path: root/lisp/doc-view.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2008-06-25 16:51:33 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2008-06-25 16:51:33 +0000
commit43f8b2756816315f8779d64bad5cf6f1e14660e6 (patch)
treedaa5e3267a033c21037dc1d3203c7f546ca59633 /lisp/doc-view.el
parentac935997e2a59b91ff18d894d47ba8a98202c22f (diff)
downloademacs-43f8b2756816315f8779d64bad5cf6f1e14660e6.tar.gz
* bookmark.el (bookmark-alist): Allow the 2 slightly different formats
used until now in bookmark.el's code. (bookmark-get-bookmark): Accept bookmark names or bookmark records. (bookmark-get-bookmark-record): Allow the 2 slightly different formats used until now in bookmark.el's code. (bookmark-set-filename): Remove special code, moved to its only caller. (bookmark-store): Use the newer format. (bookmark-make-record-default): Add arg `point-only'. Rename from bookmark-make-record-for-text-file. (bookmark--jump-via): New function. (bookmark-jump, bookmark-jump-other-window, bookmark-bmenu-2-window) (bookmark-bmenu-other-window, bookmark-bmenu-switch-other-window): Use it. (bookmark-jump-noselect, bookmark-default-handler): Don't return an alist, instead return the data implicitly by changing current buffer and point. Signal an error if the file doesn't exist. * info.el (Info-bookmark-make-record): Use bookmark-make-record-default. (Info-bookmark-jump): Use bookmark-default-handler. * image-mode.el (image-bookmark-make-record): Use bookmark-make-record-default. (image-bookmark-jump): Use bookmark-default-handler. * doc-view.el (doc-view-bookmark-make-record): Use bookmark-make-record-default. (doc-view-bookmark-jump): Use bookmark-default-handler.
Diffstat (limited to 'lisp/doc-view.el')
-rw-r--r--lisp/doc-view.el19
1 files changed, 9 insertions, 10 deletions
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 3840c5c81bd..d9120e9aa31 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -1187,29 +1187,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-make-record-default "bookmark" ())
(declare-function bookmark-prop-get "bookmark" (bookmark prop))
+(declare-function bookmark-default-handler "bookmark" (bmk))
(defun doc-view-bookmark-make-record ()
- `((filename . ,(bookmark-buffer-file-name))
- (page . ,(doc-view-current-page))
- (handler . doc-view-bookmark-jump)))
+ (nconc (bookmark-make-record-default)
+ `((page . ,(doc-view-current-page))
+ (handler . doc-view-bookmark-jump))))
;;;###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.
- (let ((filename (bookmark-prop-get bmk 'filename))
- (page (bookmark-prop-get bmk 'page)))
- (with-current-buffer (find-file-noselect filename)
+ (prog1 (bookmark-default-handler bmk)
+ (let ((page (bookmark-prop-get bmk 'page)))
(when (not (eq major-mode 'doc-view-mode))
- (doc-view-toggle-display))
+ (doc-view-toggle-display))
(with-selected-window
(or (get-buffer-window (current-buffer) 0)
(selected-window))
- (doc-view-goto-page page))
- `((buffer ,(current-buffer)) (position ,1)))))
+ (doc-view-goto-page page)))))
(provide 'doc-view)