[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 5515f28 021/110: Allow using symbols instead of words in w
From: |
Oleh Krehel |
Subject: |
[elpa] master 5515f28 021/110: Allow using symbols instead of words in word cmds |
Date: |
Sat, 11 May 2019 10:15:36 -0400 (EDT) |
branch: master
commit 5515f28779199083f20ae8fcee22b13648de6657
Author: justbur <address@hidden>
Commit: justbur <address@hidden>
Allow using symbols instead of words in word cmds
* avy.el (avy-goto-word-0-regexp): Add symbol option
* avy.el (avy-goto-word-1): Add symbol boundary optional arg
* avy.el (avy-goto-symbol-1): Add
* avy.el (avy-goto-symbol-1-above): Add
* avy.el (avy-goto-symbol-1-below): Add
---
avy.el | 34 ++++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
diff --git a/avy.el b/avy.el
index 4461cbb..6b38909 100644
--- a/avy.el
+++ b/avy.el
@@ -168,6 +168,7 @@ When nil, punctuation chars will not be matched.
"Regexp that determines positions for `avy-goto-word-0'."
:type '(choice
(const :tag "Default" "\\b\\sw")
+ (const :tag "Symbol" "\\_<\\(\\sw\\|\\s_\\)")
(const :tag "Not whitespace" "[^ \r\n\t]+")
(regexp :tag "Regex")))
@@ -1029,7 +1030,7 @@ The window scope is determined by `avy-all-windows' (ARG
negates it)."
(avy--generic-jump avy-goto-word-0-regexp arg avy-style)))
;;;###autoload
-(defun avy-goto-word-1 (char &optional arg beg end)
+(defun avy-goto-word-1 (char &optional arg beg end symbol)
"Jump to the currently visible CHAR at a word start.
The window scope is determined by `avy-all-windows' (ARG negates it)."
(interactive (list (read-char "char: " t)
@@ -1043,7 +1044,7 @@ The window scope is determined by `avy-all-windows' (ARG
negates it)."
(regexp-quote str))
(t
(concat
- "\\b"
+ (if symbol "\\_<" "\\b")
str)))))
(avy--generic-jump regex arg avy-style beg end))))
@@ -1067,6 +1068,35 @@ the visible part of the current buffer following point. "
(avy-with avy-goto-word-1
(avy-goto-word-1 char arg (point) (window-end (selected-window) t))))
+;;;###autoload
+(defun avy-goto-symbol-1 (char &optional arg)
+ "Jump to the currently visible CHAR at a symbol start.
+The window scope is determined by `avy-all-windows' (ARG negates it)."
+ (interactive (list (read-char "char: " t)
+ current-prefix-arg))
+ (avy-with avy-goto-symbol-1
+ (avy-goto-word-1 char arg nil nil t)))
+
+;;;###autoload
+(defun avy-goto-symbol-1-above (char &optional arg)
+ "Jump to the currently visible CHAR at a symbol start.
+This is a scoped version of `avy-goto-symbol-1', where the scope is
+the visible part of the current buffer up to point. "
+ (interactive (list (read-char "char: " t)
+ current-prefix-arg))
+ (avy-with avy-goto-symbol-1-above
+ (avy-goto-word-1 char arg (window-start) (point) t)))
+
+;;;###autoload
+(defun avy-goto-symbol-1-below (char &optional arg)
+ "Jump to the currently visible CHAR at a symbol start.
+This is a scoped version of `avy-goto-symbol-1', where the scope is
+the visible part of the current buffer following point. "
+ (interactive (list (read-char "char: " t)
+ current-prefix-arg))
+ (avy-with avy-goto-symbol-1-below
+ (avy-goto-word-1 char arg (point) (window-end (selected-window) t) t)))
+
(declare-function subword-backward "subword")
(defvar subword-backward-regexp)
- [elpa] master 54bce2c 036/110: avy.el (avy-move-region): Update, (continued)
- [elpa] master 54bce2c 036/110: avy.el (avy-move-region): Update, Oleh Krehel, 2019/05/11
- [elpa] master 49b070d 042/110: avy-test.el: Fix checkdoc warnings, Oleh Krehel, 2019/05/11
- [elpa] master 228ed97 039/110: avy.el (avy-action-teleport): Add and bind to "t", Oleh Krehel, 2019/05/11
- [elpa] master f2bedee 038/110: Allow "C-h" to delete for avy-goto-char-timer, Oleh Krehel, 2019/05/11
- [elpa] master d609eb9 033/110: Add avy-goto-word-0-below and avy-goto-word-0-above, Oleh Krehel, 2019/05/11
- [elpa] master b8d7163 032/110: avy.el (avy-action-goto): Add raise-frame, Oleh Krehel, 2019/05/11
- [elpa] master 07153e4 026/110: Add kill and save region functionality., Oleh Krehel, 2019/05/11
- [elpa] master dd112c8 027/110: avy.el (avy-goto-subword-1): Check char-after, Oleh Krehel, 2019/05/11
- [elpa] master 0c30cdb 034/110: avy.el (avy-action-yank): Add and bind to "y", Oleh Krehel, 2019/05/11
- [elpa] master c911850 031/110: avy.el (avy--overlay-at-full): Fix for visual-line-mode, Oleh Krehel, 2019/05/11
- [elpa] master 5515f28 021/110: Allow using symbols instead of words in word cmds,
Oleh Krehel <=
- [elpa] master a911903 029/110: avy.el (avy-goto-word-1): Work for "^A"-"^Z", Oleh Krehel, 2019/05/11
- [elpa] master a5fb936 028/110: avy.el (avy-resume): Make it show up in M-x, Oleh Krehel, 2019/05/11
- [elpa] master 20ecb9b 024/110: Use flyspell if its minor mode is active, Oleh Krehel, 2019/05/11
- [elpa] master b522bfe 023/110: avy.el (avy-resume): Add, Oleh Krehel, 2019/05/11
- [elpa] master e460d7e 025/110: avy.el (flyspell-correct-word-before-point): Declare, Oleh Krehel, 2019/05/11
- [elpa] master 05a5003 022/110: avy.el: Fix linum-related compile warnings, Oleh Krehel, 2019/05/11
- [elpa] master 430d750 019/110: avy.el (avy--line-cands): Split away from avy--line, Oleh Krehel, 2019/05/11
- [elpa] master 0f5e99b 030/110: avy.el: Use next-char-property-change, not next-overlay-change, Oleh Krehel, 2019/05/11
- [elpa] master 33af738 017/110: avy.el (avy-goto-word-1-above): Add, Oleh Krehel, 2019/05/11
- [elpa] master 105efc8 037/110: avy.el (avy-action-copy): Copy line for avy-goto-line, Oleh Krehel, 2019/05/11