From 896631767cce684848ebcbe72ddafdbab56d2201 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Fri, 4 Jan 2008 08:27:54 +0000 Subject: [PATCH] 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. --- lisp/ChangeLog | 8 ++++++++ lisp/doc-view.el | 13 ++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index de06c648443..a7021712710 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +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. + 2008-01-04 Rob Riepel * emulation/tpu-edt.el (tpu-load-xkeys): Recommend to run the diff --git a/lisp/doc-view.el b/lisp/doc-view.el index b63d86afb01..c47e98fe368 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -377,17 +377,16 @@ has finished." (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 -- 2.39.2