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

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

[elpa] master ea6f5c5 25/36: Customize how `avy-lead-face-0' is applied


From: Oleh Krehel
Subject: [elpa] master ea6f5c5 25/36: Customize how `avy-lead-face-0' is applied
Date: Tue, 19 May 2015 12:38:16 +0000

branch: master
commit ea6f5c5953fdb3c11c3d8828fa169a0928b5e092
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Customize how `avy-lead-face-0' is applied
    
    * avy.el (avy-highlight-first): New defcustom. When non-nil, use
      `avy-lead-face-0' even on terminal chars.
    (avy--overlay-pre): Update.
    (avy--overlay-at-full): Update.
    (avy--overlay-post): Update.
    
    Fixes #42
---
 avy.el |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/avy.el b/avy.el
index 4e96866..637a339 100644
--- a/avy.el
+++ b/avy.el
@@ -374,13 +374,18 @@ When GROUP is non-nil, (BEG . END) should delimit that 
regex group."
       (overlay-put ol 'display (concat str old-str))
       (push ol avy--overlays-lead))))
 
+(defcustom avy-highlight-first nil
+  "When non-nil highlight the first decision char with `avy-lead-face-0'.
+Do this even when the char is terminating."
+  :type 'boolean)
+
 (defun avy--overlay-pre (path leaf)
   "Create an overlay with PATH at LEAF.
 PATH is a list of keys from tree root to LEAF.
 LEAF is normally ((BEG . END) . WND)."
   (let ((str (propertize (apply #'string (reverse path))
                          'face 'avy-lead-face)))
-    (when (> (length str) 1)
+    (when (or avy-highlight-first (> (length str) 1))
       (set-text-properties 0 1 '(face avy-lead-face-0) str))
     (setq str (concat
                (propertize avy-current-path
@@ -435,7 +440,7 @@ LEAF is normally ((BEG . END) . WND)."
                   (caar leaf)
                 (car leaf)))
          (wnd (cdr leaf)))
-    (when (> (length str) 1)
+    (when (or avy-highlight-first (> (length str) 1))
       (set-text-properties 0 1 '(face avy-lead-face-0) str))
     (with-selected-window wnd
       (save-excursion
@@ -469,7 +474,7 @@ PATH is a list of keys from tree root to LEAF.
 LEAF is normally ((BEG . END) . WND)."
   (let ((str (propertize (apply #'string (reverse path))
                          'face 'avy-lead-face)))
-    (when (> (length str) 1)
+    (when (or avy-highlight-first (> (length str) 1))
       (set-text-properties 0 1 '(face avy-lead-face-0) str))
     (setq str (concat
                (propertize avy-current-path



reply via email to

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