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

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

[elpa] master 791c16c 02/24: avy.el (avy-goto-char-in-line): New command


From: Oleh Krehel
Subject: [elpa] master 791c16c 02/24: avy.el (avy-goto-char-in-line): New command
Date: Thu, 25 Jun 2015 10:17:46 +0000

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

    avy.el (avy-goto-char-in-line): New command
    
    Fixes #49
---
 avy.el |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/avy.el b/avy.el
index ce48da5..402f7ea 100644
--- a/avy.el
+++ b/avy.el
@@ -568,6 +568,25 @@ The window scope is determined by `avy-all-windows' (ARG 
negates it)."
      avy-style)))
 
 ;;;###autoload
+(defun avy-goto-char-in-line (char &optional arg)
+  "Jump to the currently visible CHAR in the current line.
+The window scope is determined by `avy-all-windows' (ARG negates it)."
+  (interactive (list (read-char "char: ")
+                     current-prefix-arg))
+  (let ((avy-all-windows
+         (if arg
+             (not avy-all-windows)
+           avy-all-windows)))
+    (avy--with-avy-keys avy-goto-char
+      (avy--goto
+       (avy--process
+        (save-restriction
+          (narrow-to-region (line-beginning-position)
+                            (line-end-position))
+          (avy--regex-candidates (string char)))
+        (avy--style-fn avy-style))))))
+
+;;;###autoload
 (defun avy-goto-char-2 (char1 char2 &optional arg)
   "Jump to the currently visible CHAR1 followed by CHAR2.
 The window scope is determined by `avy-all-windows' (ARG negates it)."



reply via email to

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