Skip to content

Commit

Permalink
page scrolling: allow scrolling to very end/beginning of buffer in al…
Browse files Browse the repository at this point in the history
…l situations
  • Loading branch information
davidswelt committed Feb 25, 2010
1 parent 337036b commit 9ddc39f
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions aquamacs/src/site-lisp/aquamacs-editing.el
Expand Up @@ -177,18 +177,19 @@ default in case there is not enough text."
(if cua-mode
(cua-scroll-up dir)
(scroll-up dir))
(let ((psp page-scrolling-points))
(while psp
(let ((mp (marker-position (caar psp))))
(if (and (< mp (+ (point) 100)) ;; arbitrary range
(> mp (- (point) 100)))
(progn
(goto-char mp)
;; cannot set window start, it causes problems at edges of
;; buffer for no apparent reason.
;; (set-window-start (selected-window) (cdr (car psp)))
(setq psp))
(setq psp (cdr psp))))))
(unless (or (bobp) (eobp)) ;
(let ((psp page-scrolling-points))
(while psp
(let ((mp (marker-position (caar psp))))
(if (and (< mp (+ (point) 100)) ;; arbitrary range
(> mp (- (point) 100)))
(progn
(goto-char mp)
;; cannot set window start, it causes problems at edges of
;; buffer for no apparent reason.
;; (set-window-start (selected-window) (cdr (car psp)))
(setq psp))
(setq psp (cdr psp)))))))

(when (nthcdr 9 page-scrolling-points)
(set-marker (car (nth 9 page-scrolling-points)) nil)
Expand Down

0 comments on commit 9ddc39f

Please sign in to comment.