# HG changeset patch # User Tassilo Horn # Date 1199435240 0 # Node ID 0e44918a91f4e2c4dcf6399eb8a44a4e58da019b # Parent 65113c11c1c5bfce5a41609c8b8105bd0aa8c21c 2008-01-04 Tassilo Horn * doc-view.el (doc-view-scroll-up-or-next-page) (doc-view-scroll-down-or-previous-page): Use image-scroll-up and image-scroll-down instead of the non-image equivalents. Don't rely on a signalled condition but switch pages when scrolling doesn't change the vertical position anymore. diff -r 65113c11c1c5 -r 0e44918a91f4 lisp/doc-view.el --- a/lisp/doc-view.el Fri Jan 04 07:03:47 2008 +0000 +++ b/lisp/doc-view.el Fri Jan 04 08:27:20 2008 +0000 @@ -377,17 +377,16 @@ (defun doc-view-scroll-up-or-next-page () "Scroll page up if possible, else goto next page." (interactive) - (condition-case nil - (scroll-up) - (error (doc-view-next-page)))) + (when (= (window-vscroll) (image-scroll-up nil)) + (doc-view-next-page) + (set-window-vscroll nil 0))) (defun doc-view-scroll-down-or-previous-page () "Scroll page down if possible, else goto previous page." (interactive) - (condition-case nil - (scroll-down) - (error (doc-view-previous-page) - (goto-char (point-max))))) + (when (= (window-vscroll) (image-scroll-down nil)) + (doc-view-previous-page) + (image-scroll-up nil))) ;;;; Utility Functions