aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTassilo Horn2019-10-25 22:07:39 +0200
committerTassilo Horn2019-10-25 22:19:46 +0200
commita0f7ea599919f967331173fdde2b87e50c88c4b7 (patch)
tree1b4d8fdfa5278852c05d4eb215ec1b333cc3cea7
parent25ed447b7bec3af66cf0322239cfabbaf71bef26 (diff)
downloademacs-a0f7ea599919f967331173fdde2b87e50c88c4b7.tar.gz
emacs-a0f7ea599919f967331173fdde2b87e50c88c4b7.zip
Adapt doc-view to latest image-mode changes
The functions image-scroll-down, image-scroll-up, image-next-line, and image-previous-line now return pixel values instead of multiples of character height as of commit 9c66b09950. * lisp/doc-view.el (doc-view-scroll-up-or-next-page): (doc-view-scroll-down-or-previous-page): (doc-view-next-line-or-next-page): (doc-view-previous-line-or-previous-page): (doc-view-insert-image): Adapt to image-scroll-up/down and image-next/previous-line now returning pixel values instead of multiples of character heights. Fixes bug#37874.
-rw-r--r--lisp/doc-view.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 1fbaebd6266..d88150735fe 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -598,7 +598,7 @@ Otherwise, goto next page only on typing SPC (ARG is nil)."
598 (if (or doc-view-continuous (null arg)) 598 (if (or doc-view-continuous (null arg))
599 (let ((hscroll (window-hscroll)) 599 (let ((hscroll (window-hscroll))
600 (cur-page (doc-view-current-page))) 600 (cur-page (doc-view-current-page)))
601 (when (= (window-vscroll) (image-scroll-up arg)) 601 (when (= (window-vscroll nil t) (image-scroll-up arg))
602 (doc-view-next-page) 602 (doc-view-next-page)
603 (when (/= cur-page (doc-view-current-page)) 603 (when (/= cur-page (doc-view-current-page))
604 (image-bob) 604 (image-bob)
@@ -615,7 +615,7 @@ Otherwise, goto previous page only on typing DEL (ARG is nil)."
615 (if (or doc-view-continuous (null arg)) 615 (if (or doc-view-continuous (null arg))
616 (let ((hscroll (window-hscroll)) 616 (let ((hscroll (window-hscroll))
617 (cur-page (doc-view-current-page))) 617 (cur-page (doc-view-current-page)))
618 (when (= (window-vscroll) (image-scroll-down arg)) 618 (when (= (window-vscroll nil t) (image-scroll-down arg))
619 (doc-view-previous-page) 619 (doc-view-previous-page)
620 (when (/= cur-page (doc-view-current-page)) 620 (when (/= cur-page (doc-view-current-page))
621 (image-eob) 621 (image-eob)
@@ -631,7 +631,7 @@ at the bottom edge of the page moves to the next page."
631 (if doc-view-continuous 631 (if doc-view-continuous
632 (let ((hscroll (window-hscroll)) 632 (let ((hscroll (window-hscroll))
633 (cur-page (doc-view-current-page))) 633 (cur-page (doc-view-current-page)))
634 (when (= (window-vscroll) (image-next-line arg)) 634 (when (= (window-vscroll nil t) (image-next-line arg))
635 (doc-view-next-page) 635 (doc-view-next-page)
636 (when (/= cur-page (doc-view-current-page)) 636 (when (/= cur-page (doc-view-current-page))
637 (image-bob) 637 (image-bob)
@@ -647,7 +647,7 @@ at the top edge of the page moves to the previous page."
647 (if doc-view-continuous 647 (if doc-view-continuous
648 (let ((hscroll (window-hscroll)) 648 (let ((hscroll (window-hscroll))
649 (cur-page (doc-view-current-page))) 649 (cur-page (doc-view-current-page)))
650 (when (= (window-vscroll) (image-previous-line arg)) 650 (when (= (window-vscroll nil t) (image-previous-line arg))
651 (doc-view-previous-page) 651 (doc-view-previous-page)
652 (when (/= cur-page (doc-view-current-page)) 652 (when (/= cur-page (doc-view-current-page))
653 (image-eob) 653 (image-eob)
@@ -1429,7 +1429,7 @@ ARGS is a list of image descriptors."
1429 (vscroll (image-mode-window-get 'vscroll win))) 1429 (vscroll (image-mode-window-get 'vscroll win)))
1430 ;; Reset scroll settings, in case they were changed. 1430 ;; Reset scroll settings, in case they were changed.
1431 (if hscroll (set-window-hscroll win hscroll)) 1431 (if hscroll (set-window-hscroll win hscroll))
1432 (if vscroll (set-window-vscroll win vscroll))))))))) 1432 (if vscroll (set-window-vscroll win vscroll t)))))))))
1433 1433
1434(defun doc-view-sort (a b) 1434(defun doc-view-sort (a b)
1435 "Return non-nil if A should be sorted before B. 1435 "Return non-nil if A should be sorted before B.