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

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

[elpa] master dfe24f3 11/17: Add `avi-word-punc-regexp` defcustom


From: Oleh Krehel
Subject: [elpa] master dfe24f3 11/17: Add `avi-word-punc-regexp` defcustom
Date: Fri, 08 May 2015 13:43:42 +0000

branch: master
commit dfe24f3d80ffa6093fea2a6600ca8179638394d7
Author: Kaushal Modi <address@hidden>
Commit: Kaushal Modi <address@hidden>

    Add `avi-word-punc-regexp` defcustom
    
    - Setting this to nil will disable jumping to punctuation chars during
      `avi-goto-word-1`.
    - Set this to a regexp of punctuation chars you want to match otherwise.
    - "[!-/:address@hidden" will match all printable punctuation chars.
---
 avy-jump.el |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/avy-jump.el b/avy-jump.el
index c1c03ab..ed0554a 100644
--- a/avy-jump.el
+++ b/avy-jump.el
@@ -42,6 +42,12 @@
   "When non-nil, a gray background will be added during the selection."
   :type 'boolean)
 
+(defcustom avi-word-punc-regexp "[!-/:address@hidden"
+  "Regexp of punctuation characters that should be matched when calling
+`avi-goto-word-1' command. When nil, punctuation chars will not be matched.
+
+\"[!-/:address@hidden" will match all printable punctuation chars.")
+
 (defface avi-lead-face
   '((t (:foreground "white" :background "#e52b50")))
   "Face used for the leading chars.")
@@ -249,7 +255,8 @@ Read one char with which the word should start."
   (interactive)
   (let* ((str (string (read-char "char: ")))
          (candidates (avi--regex-candidates
-                      (if (string-match "[,.+-*/=]" str)
+                      (if (and avi-word-punc-regexp
+                               (string-match avi-word-punc-regexp str))
                           str
                         (concat
                          "\\b"



reply via email to

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