;;; Code:
-;;; Requirements
+;;;; Requirements
(require 'cl-lib)
(require 'timer)
(declare-function hexrgb-increment-hue "hexrgb")
-;;; Configuration stuff
+;;;; Configuration stuff
(defgroup on-screen nil
"Guide your eyes while scrolling."
(defface on-screen-shadow
'((((class color) (min-colors 88) (background light))
- :background "#f2efcb" ;; alternative: "#f5f4ff" is a bit less intrusive
+ :background "#f2efcb" ; alternative: "#f5f4ff" is a bit less intrusive
)
(((class color) (min-colors 88) (background dark))
:background "#272620")
Highlighting will be inhibited if the result is non-nil.")
-;;; Other variables
+;;;; Other variables
(defvar on-screen-overlay-priority 30 ; > stripe buffer, < ediff, isearch
"Priority for all on-screen overlays.")
(defvar on-screen-last-change 0)
-;;; User Commands
+;;;; User Commands
;;;###autoload
(define-minor-mode on-screen-mode
(defalias 'global-on-screen-mode 'on-screen-global-mode)
-;;; Internal functions
+;;;; Internal functions
(defun on-screen-window-start (&optional window)
"Like `window-start', but exclude partially visible lines."
start
(cl-destructuring-bind (_x _y rtop _rbot rowh _vpos) vis
(if (< (/ (float rtop) (+ rtop rowh))
- (if (floatp on-screen-treat-cut-lines) on-screen-treat-cut-lines .4)) ;; count as visible
+ (if (floatp on-screen-treat-cut-lines) on-screen-treat-cut-lines .4)) ; count as visible
start
(with-current-buffer (window-buffer window)
(save-excursion
end
(cl-destructuring-bind (_x _y _rtop rbot rowh _vpos) vis
(if (< (/ (float rbot) (+ rbot rowh))
- (if (floatp on-screen-treat-cut-lines) on-screen-treat-cut-lines .4)) ;; count as visible
+ (if (floatp on-screen-treat-cut-lines) on-screen-treat-cut-lines .4)) ; count as visible
end
(with-current-buffer (window-buffer window)
(save-excursion