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

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

[elpa] master 08370cd 069/110: Add option to limit avy-goto-subword-0 sc


From: Oleh Krehel
Subject: [elpa] master 08370cd 069/110: Add option to limit avy-goto-subword-0 scope
Date: Sat, 11 May 2019 10:15:46 -0400 (EDT)

branch: master
commit 08370cdbc35ff41646461a02d6d9758dfce30c20
Author: walseb <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Add option to limit avy-goto-subword-0 scope
    
    Fixes #235
---
 avy.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/avy.el b/avy.el
index bf82845..3fc645e 100644
--- a/avy.el
+++ b/avy.el
@@ -1341,10 +1341,11 @@ This variable is used by `avy-goto-subword-0' and 
`avy-goto-subword-1'."
   :type '(repeat character))
 
 ;;;###autoload
-(defun avy-goto-subword-0 (&optional arg predicate)
+(defun avy-goto-subword-0 (&optional arg predicate beg end)
   "Jump to a word or subword start.
 
 The window scope is determined by `avy-all-windows' (ARG negates it).
+BEG and END narrow the scope where candidates are searched.
 
 When PREDICATE is non-nil it's a function of zero parameters that
 should return true."
@@ -1360,10 +1361,10 @@ should return true."
           (dolist (char avy-subword-extra-word-chars)
             (modify-syntax-entry char "w" syn-tbl))
           (with-syntax-table syn-tbl
-            (let ((ws (window-start))
+            (let ((ws (or beg (window-start)))
                   window-cands)
               (save-excursion
-                (goto-char (window-end (selected-window) t))
+                (goto-char (or end (window-end (selected-window) t)))
                 (subword-backward)
                 (while (> (point) ws)
                   (when (or (null predicate)



reply via email to

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