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

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

[elpa] master a39f689 22/36: Allow all kinds of styles for `avy-goto-lin


From: Oleh Krehel
Subject: [elpa] master a39f689 22/36: Allow all kinds of styles for `avy-goto-line'
Date: Tue, 19 May 2015 12:38:15 +0000

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

    Allow all kinds of styles for `avy-goto-line'
    
    * avy.el (avy--line): Use the custom style. Use line end postion for
      'post style.
    
    Fixes abo-abo/ace-link#17
    
    Any of the following do something different now:
    
    (setq avy-styles-alist
          '((avy-goto-line . post)))
    (setq avy-styles-alist
          '((avy-goto-line . at)))
    (setq avy-styles-alist
          '((avy-goto-line . at-full)))
    (setq avy-styles-alist
          '((avy-goto-line . pre)))
---
 avy.el |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/avy.el b/avy.el
index 192f58b..42fe993 100644
--- a/avy.el
+++ b/avy.el
@@ -640,9 +640,13 @@ The window scope is determined by `avy-all-windows' (ARG 
negates it)."
             (while (< (point) (point-max))
               (unless (get-char-property
                        (max (1- (point)) ws) 'invisible)
-                (push (cons (point) (selected-window)) candidates))
+                (push (cons
+                       (if (eq avy-style 'post)
+                           (line-end-position)
+                         (line-beginning-position))
+                       (selected-window)) candidates))
               (forward-line 1))))))
-    (avy--process (nreverse candidates) #'avy--overlay-pre)))
+    (avy--process (nreverse candidates) (avy--style-fn avy-style))))
 
 ;;;###autoload
 (defun avy-goto-line (&optional arg)



reply via email to

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