]> git.eshelyaron.com Git - emacs.git/commitdiff
Replace 2 checks in rmailsum.el with 'pos-visible-in-window-p'
authorCharles A. Roelli <charles@aurox.ch>
Thu, 23 Aug 2018 20:10:08 +0000 (22:10 +0200)
committerCharles A. Roelli <charles@aurox.ch>
Thu, 23 Aug 2018 20:10:08 +0000 (22:10 +0200)
* lisp/mail/rmailsum.el (rmail-summary-scroll-msg-up)
(rmail-summary-scroll-msg-down): Use 'pos-visible-in-window-p'
instead of checking the condition by hand.

lisp/mail/rmailsum.el

index e5363d2198c95657138a5b222c1f45fe6b0ba4f6..10345b63ae265e0819bbd0ca89dd1f8c68bec18a 100644 (file)
@@ -1315,11 +1315,7 @@ advance to the next message."
                (select-window rmail-buffer-window)
                (prog1
                    ;; Is EOB visible in the buffer?
-                   (save-excursion
-                     (let ((ht (window-height)))
-                       (move-to-window-line (- ht 2))
-                       (end-of-line)
-                       (eobp)))
+                    (pos-visible-in-window-p (point-max))
                  (select-window rmail-summary-window)))
              (if (not rmail-summary-scroll-between-messages)
                  (error "End of buffer")
@@ -1342,10 +1338,7 @@ move to the previous message."
                (select-window rmail-buffer-window)
                (prog1
                    ;; Is BOB visible in the buffer?
-                   (save-excursion
-                     (move-to-window-line 0)
-                     (beginning-of-line)
-                     (bobp))
+                   (pos-visible-in-window-p (point-min))
                  (select-window rmail-summary-window)))
              (if (not rmail-summary-scroll-between-messages)
                  (error "Beginning of buffer")