+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:
`((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)