From: Tassilo Horn Date: Fri, 4 Jan 2008 13:21:42 +0000 (+0000) Subject: 2008-01-04 Tassilo Horn X-Git-Tag: emacs-pretest-23.0.90~8697 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bcc758eca97781b4849e0ce4bfe8a0589ece0ea3;p=emacs.git 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. --- 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