[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c03f4b0 33/50: new user variable: on-screen-inhibit-highli
From: |
Michael Heerdegen |
Subject: |
[elpa] master c03f4b0 33/50: new user variable: on-screen-inhibit-highlighting |
Date: |
Mon, 09 Nov 2015 03:35:51 +0000 |
branch: master
commit c03f4b0d87435468884d472e93a79d22c82b0175
Author: Michael Heerdegen <address@hidden>
Commit: Michael Heerdegen <address@hidden>
new user variable: on-screen-inhibit-highlighting
---
on-screen.el | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/on-screen.el b/on-screen.el
index b65cb37..cd67ffb 100644
--- a/on-screen.el
+++ b/on-screen.el
@@ -236,6 +236,15 @@ a non-nil value may make scrolling stuttering on slow
computers."
:type '(choice (const :tag "Off" nil)
(integer :value 2)))
+(defvar on-screen-inhibit-highlighting nil
+ "Disable highlighting if non-nil.
+This variable is checked before highlighting is actually being
+performed, with the according buffer being current.
+
+If a function, it will be called with zero arguments.
+Highlighting will be inhibited if the result is non-nil.")
+
+
;;; Other variables
(defvar on-screen-overlay-priority 30 ; > stripe buffer, < ediff, isearch
@@ -271,6 +280,10 @@ Type M-x customize-group on-screen RET for configuration."
With a prefix argument ARG, enable the mode if ARG is positive,
and disable it otherwise. If called from Lisp, enable the mode
if ARG is omitted or nil.
+
+You can make use of `on-screen-inhibit-highlighting' to prevent
+highlighting on a per-buffer basis.
+
Type M-x customize-group on-screen RET for configuration."
:group 'on-screen :global t
(when on-screen-global-mode
@@ -608,7 +621,13 @@ highlightings and clear all associated data."
(defun on-screen-enabled-p (&optional buffer)
"Return non-nil if on-screen is enabled in BUFFER."
(with-current-buffer (or buffer (current-buffer))
- (if on-screen-global-mode t on-screen-mode)))
+ (and
+ (if on-screen-global-mode t on-screen-mode)
+ (cond
+ ((not on-screen-inhibit-highlighting) t)
+ ((functionp on-screen-inhibit-highlighting)
+ (not (funcall on-screen-inhibit-highlighting)))
+ (t nil)))))
(defun on-screen-initialize ()
"Prepare for using on-screen."
- [elpa] master a7630ca 24/50: convert to cl-lib, (continued)
- [elpa] master a7630ca 24/50: convert to cl-lib, Michael Heerdegen, 2015/11/08
- [elpa] master 8256496 25/50: use a more modest gray for on-screen-narrow-line face, Michael Heerdegen, 2015/11/08
- [elpa] master b1c1f7e 32/50: new option: on-screen-drawing-threshold, Michael Heerdegen, 2015/11/08
- [elpa] master 259440a 26/50: add Package-Requires header, Michael Heerdegen, 2015/11/08
- [elpa] master 098325c 29/50: set default value of on-screen-treat-cut-lines to t, Michael Heerdegen, 2015/11/08
- [elpa] master 23cf5db 30/50: use lexical binding, Michael Heerdegen, 2015/11/08
- [elpa] master 787fe34 31/50: bump version to 1.1, Michael Heerdegen, 2015/11/08
- [elpa] master bef0f6d 37/50: silence compiler when hexrgb.el is not installed, Michael Heerdegen, 2015/11/08
- [elpa] master ef81e20 35/50: change default of on-screen-treat-cut-lines back to nil, Michael Heerdegen, 2015/11/08
- [elpa] master 7012d04 41/50: bump version to 1.3, Michael Heerdegen, 2015/11/08
- [elpa] master c03f4b0 33/50: new user variable: on-screen-inhibit-highlighting,
Michael Heerdegen <=
- [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, 2015/11/08