changeset 87580:c47e66c6d239

2008-01-04 Tassilo Horn <tassilo@member.fsf.org> * doc-view.el (doc-view-scroll-up-or-next-page) (doc-view-scroll-down-or-previous-page): Don't scroll to the top/bottom again when on the first/last page.
author Tassilo Horn <tassilo@member.fsf.org>
date Fri, 04 Jan 2008 13:21:16 +0000
parents 10679233f935
children d8139e495f52
files lisp/doc-view.el
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/doc-view.el	Fri Jan 04 13:04:00 2008 +0000
+++ b/lisp/doc-view.el	Fri Jan 04 13:21:16 2008 +0000
@@ -380,15 +380,19 @@
   "Scroll page up if possible, else goto next page."
   (interactive)
   (when (= (window-vscroll) (image-scroll-up nil))
-    (doc-view-next-page)
-    (set-window-vscroll nil 0)))
+    (let ((cur-page doc-view-current-page))
+      (doc-view-next-page)
+      (when (/= cur-page doc-view-current-page)
+	(set-window-vscroll nil 0)))))
 
 (defun doc-view-scroll-down-or-previous-page ()
   "Scroll page down if possible, else goto previous page."
   (interactive)
   (when (= (window-vscroll) (image-scroll-down nil))
-    (doc-view-previous-page)
-    (image-scroll-up nil)))
+    (let ((cur-page doc-view-current-page))
+      (doc-view-previous-page)
+      (when (/= cur-page doc-view-current-page)
+	(image-scroll-up nil)))))
 
 ;;;; Utility Functions