[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 13bf083 39/50: handle on-screen-treat-cut-lines -> t nicel
From: |
Michael Heerdegen |
Subject: |
[elpa] master 13bf083 39/50: handle on-screen-treat-cut-lines -> t nicely |
Date: |
Mon, 09 Nov 2015 03:35:53 +0000 |
branch: master
commit 13bf08362dbf796db1d9baef7cf02304b19d6434
Author: Michael Heerdegen <address@hidden>
Commit: Michael Heerdegen <address@hidden>
handle on-screen-treat-cut-lines -> t nicely
---
on-screen.el | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/on-screen.el b/on-screen.el
index 9e0e54e..08048bb 100644
--- a/on-screen.el
+++ b/on-screen.el
@@ -229,6 +229,8 @@ changes to a buffer highlighting is always removed to avoid
confusion."
:group 'on-screen :type 'boolean)
+(defvar on-screen-treat-cut-lines--default-fraction .3)
+
(defcustom on-screen-treat-cut-lines nil
"Whether to care about vertically cut lines.
If nil, always count lines at the window start or end that are
@@ -237,9 +239,11 @@ number between 0 and 1, meaning that lines will count as
visible
when the hidden part of them is less than this number. Note that
a non-nil value may make scrolling stuttering on slow computers."
:group 'on-screen
- :type '(choice (const :tag "Count vertically cut lines as visible" nil)
- (float :tag "Count lines with hidden part less than this as
visible"
- :value .4)))
+ :type `(choice (const :tag "Count partially visible lines as visible" nil)
+ (const :tag "Count partially visible lines as not visible" t)
+ (float
+ :tag "Count lines with hidden part less than this as visible"
+ :value ,on-screen-treat-cut-lines--default-fraction)))
(defcustom on-screen-drawing-threshold 2
"If set, highlight only when scrolled at least that many lines."
@@ -307,6 +311,11 @@ Type M-x customize-group on-screen RET for configuration."
;;;; Internal functions
+(defun on-screen--treat-cut-lines-get-fraction ()
+ (if (floatp on-screen-treat-cut-lines)
+ on-screen-treat-cut-lines
+ on-screen-treat-cut-lines--default-fraction))
+
(defun on-screen-window-start (&optional window)
"Like `window-start', but exclude partially visible lines."
(let* ((start (window-start window))
@@ -315,7 +324,7 @@ Type M-x customize-group on-screen RET for configuration."
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
+ (on-screen--treat-cut-lines-get-fraction)) ; count as visible
start
(with-current-buffer (window-buffer window)
(save-excursion
@@ -331,7 +340,7 @@ Type M-x customize-group on-screen RET for configuration."
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
+ (on-screen--treat-cut-lines-get-fraction)) ; count as visible
end
(with-current-buffer (window-buffer window)
(save-excursion
- [elpa] master c03f4b0 33/50: new user variable: on-screen-inhibit-highlighting, (continued)
- [elpa] master c03f4b0 33/50: new user variable: on-screen-inhibit-highlighting, Michael Heerdegen, 2015/11/08
- [elpa] master b51ac73 36/50: use separate face for "line" style highlighting, Michael Heerdegen, 2015/11/08
- [elpa] master 4014e32 38/50: make comments respect conventions, Michael Heerdegen, 2015/11/08
- [elpa] master 49d5546 42/50: fix whitespace, no code change, Michael Heerdegen, 2015/11/08
- [elpa] master 7bb7f0d 46/50: add .gitignore, Michael Heerdegen, 2015/11/08
- [elpa] master 009d1a4 44/50: wrap (require 'cl-lib) in eval-when-compile, Michael Heerdegen, 2015/11/08
- [elpa] master 387cb55 40/50: add on-screen-unload-function, Michael Heerdegen, 2015/11/08
- [elpa] master 1570a0d 49/50: add "on-screen" to externals-list, Michael Heerdegen, 2015/11/08
- [elpa] master d08c167 48/50: on-screen: merge from remote repo, Michael Heerdegen, 2015/11/08
- [elpa] master 8e3c53d 34/50: bump version to 1.2, Michael Heerdegen, 2015/11/08
- [elpa] master 13bf083 39/50: handle on-screen-treat-cut-lines -> t nicely,
Michael Heerdegen <=
- [elpa] master e023bf8 45/50: bump version, Michael Heerdegen, 2015/11/08
- [elpa] master 65bbd8d 50/50: Merge commit 'a66fc082499967627cb89802fc2783accea5cb4b', Michael Heerdegen, 2015/11/08
- [elpa] master a042e0d 28/50: avoid error when user sets on-screen-treat-cut-lines to just t, Michael Heerdegen, 2015/11/08
- [elpa] master dd3930b 43/50: convey copyright to the FSF, Michael Heerdegen, 2015/11/08
- [elpa] master a66fc08 47/50: remove redundant :group specs, Michael Heerdegen, 2015/11/08