emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master f4b1ef2 17/50: new option: on-screen-remove-when-edit, de


From: Michael Heerdegen
Subject: [elpa] master f4b1ef2 17/50: new option: on-screen-remove-when-edit, decrease overlay priority
Date: Mon, 09 Nov 2015 03:35:44 +0000

branch: master
commit f4b1ef29011a67aeb6184c7a53a5691a12cc0e98
Author: Michael Heerdegen <address@hidden>
Commit: Michael Heerdegen <address@hidden>

    new option: on-screen-remove-when-edit, decrease overlay priority
    
    - Make overlay removing when changing a buffer customizable (new option
      `on-screen-remove-when-edit').  Off by default (previously, the
      feature was always enabled).
    
    - Radically decreased on-screen-overlay-priority (to 30).  It should be
      less than isearch and ediff overlay priorities, but still larger than
      e.g. stripe-buffer overlay priority.
---
 on-screen.el |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/on-screen.el b/on-screen.el
index 898829d..7f74c77 100644
--- a/on-screen.el
+++ b/on-screen.el
@@ -209,6 +209,10 @@ drawn highlighting will remain fixed relative to the text 
even
 if you scroll further until `on-screen-delay' is over."
   :group 'on-screen :type 'boolean)
 
+(defcustom on-screen-remove-when-edit nil
+  "Whether to instantly remove highlighting when editing."
+  :group 'on-screen :type 'boolean)
+
 (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
@@ -223,7 +227,7 @@ a non-nil value may make scrolling stuttering on slow 
computers."
 
 ;;; Other variables
 
-(defvar on-screen-overlay-priority 9999
+(defvar on-screen-overlay-priority 30     ; > stripe buffer, < ediff, isearch
   "Priority for all on-screen overlays.")
 
 (defvar on-screen-initialized-p nil
@@ -559,11 +563,12 @@ had changed."
   "Reset highligting for current buffer after it was changed.
 This has to be done for all its windows.  Goes to
 `after-change-functions'."
-  (let ((buf (current-buffer)))
-    (when (on-screen-enabled-p buf)
-      (dolist (win (on-screen-get-windows t))
-        (when (eq (window-buffer win) buf)
-          (on-screen-remove-highlighting win))))))
+  (when on-screen-remove-when-edit
+    (let ((buf (current-buffer)))
+      (when (on-screen-enabled-p buf)
+       (dolist (win (on-screen-get-windows t))
+         (when (eq (window-buffer win) buf)
+           (on-screen-remove-highlighting win)))))))
 
 (defun on-screen-after-wconf-change ()
   "Clean up after the window configuration has changed.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]