Created
January 7, 2013 08:42
-
-
Save jorgenschaefer/4473389 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun window-bottom--is-past-buffer/lines () | |
| "Return a true value iff we scrolled past the buffer end." | |
| (save-excursion | |
| (goto-char (window-start)) | |
| (let ((lines 0) | |
| (max-lines (window-height))) | |
| (while (and (< lines max-lines) | |
| (re-search-forward "[\n\C-m]" nil t)) | |
| (setq lines (+ 1 lines))) | |
| (goto-char (point-max)) | |
| (when (bolp) | |
| (setq lines (+ lines 1))) | |
| (< lines max-lines)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment