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

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

[elpa] master 513c429 41/78: Make avy-goto-char-timer faster for org-mod


From: Oleh Krehel
Subject: [elpa] master 513c429 41/78: Make avy-goto-char-timer faster for org-mode
Date: Sat, 23 Jan 2016 13:59:58 +0000

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

    Make avy-goto-char-timer faster for org-mode
    
    * avy.el (avy--read-string-timer): Use `avy--find-visible-regions'.
    (avy-goto-char-timer): Make ARG work properly to negate
    `avy-all-windows'.
    
    Re #100
---
 avy.el |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/avy.el b/avy.el
index 1291834..8296def 100644
--- a/avy.el
+++ b/avy.el
@@ -1132,15 +1132,18 @@ read string immediately instead of waiting for another 
char for
                                (window-list)
                              (list (selected-window))))
                 (with-selected-window win
-                  (save-excursion
-                    (goto-char (window-start))
-                    (setq regex (regexp-quote str))
-                    (while (re-search-forward regex (window-end) t)
-                      (unless (get-char-property (point) 'invisible)
-                        (let ((ov (make-overlay (match-beginning 0) (match-end 
0))))
-                          (push ov overlays)
-                          (overlay-put ov 'window (selected-window))
-                          (overlay-put ov 'face 
'avy-goto-char-timer-face)))))))))
+                  (dolist (pair (avy--find-visible-regions
+                                 (window-start)
+                                 (window-end (selected-window) t)))
+                    (save-excursion
+                      (goto-char (car pair))
+                      (setq regex (regexp-quote str))
+                      (while (re-search-forward regex (cdr pair) t)
+                        (unless (get-char-property (point) 'invisible)
+                          (let ((ov (make-overlay (match-beginning 0) 
(match-end 0))))
+                            (push ov overlays)
+                            (overlay-put ov 'window (selected-window))
+                            (overlay-put ov 'face 
'avy-goto-char-timer-face))))))))))
           str)
       (dolist (ov overlays)
         (delete-overlay ov)))))
@@ -1150,7 +1153,12 @@ read string immediately instead of waiting for another 
char for
   "Read one or many consecutive chars and jump to the first one.
 The window scope is determined by `avy-all-windows' (ARG negates it)."
   (interactive "P")
-  (let ((str (avy--read-string-timer)))
+  (let ((str
+         (let ((avy-all-windows
+                (if arg
+                    (not avy-all-windows)
+                  avy-all-windows)))
+           (avy--read-string-timer))))
     (avy-with avy-goto-char-timer
       (avy--generic-jump
        (regexp-quote str)



reply via email to

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