From bcc758eca97781b4849e0ce4bfe8a0589ece0ea3 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Fri, 4 Jan 2008 13:21:42 +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): Don't scroll to the top/bottom again when on the first/last page. --- lisp/ChangeLog | 6 ++++++ lisp/doc-view.el | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fad86b2b545..becb813171b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2008-01-04 Tassilo Horn + + * 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. + 2008-01-04 Juanma Barranquero * bs.el (bs--get-mode-name): Fix typo in previous change. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 2f1d9f53783..9c153dc584f 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -380,15 +380,19 @@ has finished." "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 -- 2.39.5