Fix bug#16090.

* lisp/doc-view.el (doc-view-bookmark-jump): Use
`bookmark-after-jump-hook' to jump to the right page after the
buffer is shown in a window.
This commit is contained in:
Tassilo Horn 2014-04-04 19:42:55 +02:00
parent 114d739bef
commit 3ccd4eafd3
2 changed files with 19 additions and 10 deletions

View file

@ -1,3 +1,9 @@
2014-04-04 Tassilo Horn <tsdh@gnu.org>
* doc-view.el (doc-view-bookmark-jump): Use
`bookmark-after-jump-hook' to jump to the right page after the
buffer is shown in a window. (bug#16090)
2014-04-04 Eli Zaretskii <eliz@gnu.org>
* international/characters.el (mirroring): Fix last change:

View file

@ -1862,20 +1862,23 @@ See the command `doc-view-mode' for more information on this mode."
`((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.
(prog1 (bookmark-default-handler bmk)
(let ((page (bookmark-prop-get bmk 'page)))
(when (not (eq major-mode 'doc-view-mode))
(doc-view-toggle-display))
(with-selected-window
(or (get-buffer-window (current-buffer) 0)
(selected-window))
(doc-view-goto-page page)))))
(let ((page (bookmark-prop-get bmk 'page))
(show-fn-sym (make-symbol "doc-view-bookmark-after-jump-hook")))
(fset show-fn-sym
(lambda ()
(remove-hook 'bookmark-after-jump-hook show-fn-sym)
(when (not (eq major-mode 'doc-view-mode))
(doc-view-toggle-display))
(with-selected-window
(or (get-buffer-window (current-buffer) 0)
(selected-window))
(doc-view-goto-page page))))
(add-hook 'bookmark-after-jump-hook show-fn-sym)
(bookmark-default-handler bmk)))
(provide 'doc-view)