(scroll-down-command arg))
(arg (follow-scroll-down-arg arg))
(t
- (let* ((windows (follow-all-followers))
+ (let* ((orig-point (point))
+ (windows (follow-all-followers))
(win (car (reverse windows)))
(start (window-start (car windows))))
(if (eq start (point-min))
(select-window win)
(goto-char start)
(vertical-motion (- (- (window-height win)
- (if header-line-format 2 1)
- next-screen-context-lines)))
+ (if header-line-format 2 1) ; always mode-line
+ (if tab-line-format 1 0)
+ next-screen-context-lines)))
(set-window-start win (point))
- (goto-char start)
- (vertical-motion (- next-screen-context-lines 1))
+ (if (< orig-point (window-end win t))
+ (goto-char orig-point)
+ (goto-char start)
+ (vertical-motion (- next-screen-context-lines 1)))
(setq follow-internal-force-redisplay t))))))
(put 'follow-scroll-down 'scroll-command t)
(let* ((win (or win (selected-window)))
(edges (window-inside-pixel-edges win))
(ht (- (nth 3 edges) (nth 1 edges)))
- (last-line-pos (posn-point (posn-at-x-y 0 (1- ht) win))))
+ (last-line-pos (posn-point
+ (posn-at-x-y 0 (+ (window-header-line-height win)
+ (window-tab-line-height win)
+ (1- ht))
+ win))))
(if (pos-visible-in-window-p last-line-pos win)
(let ((end (window-end win t)))
(list end (pos-visible-in-window-p (point-max) win)))