From: Tassilo Horn Date: Fri, 4 Apr 2014 17:42:55 +0000 (+0200) Subject: Fix bug#16090. X-Git-Tag: emacs-24.3.90~41 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3ccd4eafd3d51285b2d9eb4e5e83b3be20dbfe9f;p=emacs.git 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a49b0e7dc7c..7ab920990b4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-04-04 Tassilo Horn + + * 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 * international/characters.el (mirroring): Fix last change: diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 6706865e598..09d5925b3e2 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -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)