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

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

[elpa] master c581478 3/6: avy-jump.el (avi--overlay-at): New overlay st


From: Oleh Krehel
Subject: [elpa] master c581478 3/6: avy-jump.el (avi--overlay-at): New overlay style
Date: Thu, 16 Apr 2015 12:13:05 +0000

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

    avy-jump.el (avi--overlay-at): New overlay style
---
 avy-jump.el |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/avy-jump.el b/avy-jump.el
index 7419319..9503ee9 100644
--- a/avy-jump.el
+++ b/avy-jump.el
@@ -118,6 +118,28 @@ LEAF is ((BEG . END) . WND)."
      (car leaf))
    (cdr leaf)))
 
+(defun avi--overlay-at (path leaf)
+  "Create an overlay with STR at LEAF.
+PATH is a list of keys from tree root to LEAF.
+LEAF is ((BEG . END) . WND)."
+  (let ((str (propertize
+              (string (car (last path)))
+              'face 'avi-lead-face))
+        (pt (if (consp (car leaf))
+                (caar leaf)
+              (car leaf)))
+        (wnd (cdr leaf)))
+    (let ((ol (make-overlay pt (1+ pt)
+                            (window-buffer wnd)))
+          (old-str (with-selected-window wnd
+                     (buffer-substring pt (1+ pt)))))
+      (when avi-background
+        (setq old-str (propertize
+                       old-str 'face 'aw-background-face)))
+      (overlay-put ol 'window wnd)
+      (overlay-put ol 'display str)
+      (push ol aw-overlays-lead))))
+
 (defun avi--overlay-post (path leaf)
   "Create an overlay with STR at LEAF.
 PATH is a list of keys from tree root to LEAF.



reply via email to

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