From 7997af15ecc64525a3157306c3bf3936621f3f1d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:42:22 -0500 Subject: [PATCH 01/12] Add .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9d6b97a..8dc9e4e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ test/.packages +*.elc From 003ee518be808d115ac22120c1e1867732c576ba Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 24 Nov 2024 00:19:55 -0500 Subject: [PATCH 02/12] Add: -*- lexical-binding: t; -*- --- evil-snipe.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evil-snipe.el b/evil-snipe.el index fa8174a..a252b28 100755 --- a/evil-snipe.el +++ b/evil-snipe.el @@ -1,4 +1,4 @@ -;;; evil-snipe.el --- emulate vim-sneak & vim-seek +;;; evil-snipe.el --- emulate vim-sneak & vim-seek -*- lexical-binding: t; -*- ;; ;; Copyright (C) 2014-20 Henrik Lissner ;; From 525a950eea9d5c8e69d648742d0d3f3d76d4a47b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 24 Nov 2024 00:22:48 -0500 Subject: [PATCH 03/12] Fix: You should depend on (emacs "25.1") if you need `char-fold-to-regexp'. --- evil-snipe.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evil-snipe.el b/evil-snipe.el index a252b28..32c51dc 100755 --- a/evil-snipe.el +++ b/evil-snipe.el @@ -9,7 +9,7 @@ ;; Version: 2.1.3 ;; Keywords: emulation, vim, evil, sneak, seek ;; Homepage: https://github.com/hlissner/evil-snipe -;; Package-Requires: ((emacs "24.4") (evil "1.2.12") (cl-lib "0.5")) +;; Package-Requires: ((emacs "25.1") (evil "1.2.12") (cl-lib "0.5")) ;; ;; This file is not part of GNU Emacs. From 2c96ac8f70c1251a18777b8c01f5959b136920ab Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 24 Nov 2024 00:24:34 -0500 Subject: [PATCH 04/12] =?UTF-8?q?Fix:=20Unused=20lexical=20variable=20?= =?UTF-8?q?=E2=80=98match=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- evil-snipe.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/evil-snipe.el b/evil-snipe.el index 32c51dc..4ac663b 100755 --- a/evil-snipe.el +++ b/evil-snipe.el @@ -425,8 +425,7 @@ is the transient map to activate afterwards." (defun evil-snipe--seek (count data &optional internal-p) "Perform a snipe and adjust cursor position depending on mode." (let ((orig-point (point)) - (forward-p (> count 0)) - (match (mapconcat #'cdr data ""))) + (forward-p (> count 0))) ;; Adjust search starting point (if forward-p (forward-char)) (unless evil-snipe--consume-match From cb942e9394c4a2b18b2707f353ae72e31643b094 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 24 Nov 2024 00:27:41 -0500 Subject: [PATCH 05/12] =?UTF-8?q?Fix:=20Reference=20to=20free=20variable?= =?UTF-8?q?=20=E2=80=98evil-snipe-parent-transient-map=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- evil-snipe.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/evil-snipe.el b/evil-snipe.el index 4ac663b..1af9829 100755 --- a/evil-snipe.el +++ b/evil-snipe.el @@ -211,6 +211,11 @@ directly, unless you want to change the default number of characters to search.") (defvar evil-snipe--transient-map-func nil) +(defvar evil-snipe-parent-transient-map + (let ((map (make-sparse-keymap))) + (define-key map ";" #'evil-snipe-repeat) + (define-key map "," #'evil-snipe-repeat-reverse) + map)) ;; ;;; Faces @@ -608,12 +613,6 @@ explicitly choose the function names." "," #'evil-snipe-repeat-reverse)) map)) -(defvar evil-snipe-parent-transient-map - (let ((map (make-sparse-keymap))) - (define-key map ";" #'evil-snipe-repeat) - (define-key map "," #'evil-snipe-repeat-reverse) - map)) - ;;;###autoload (defun turn-on-evil-snipe-mode () "Enable evil-snipe-mode in the current buffer." From 7b2f43c8f71f82fcb38318e2b1991ee7fa6e54bb Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 24 Nov 2024 00:31:27 -0500 Subject: [PATCH 06/12] Fix: Alias should be declared before its referent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes: - Alias for ‘evil-snipe-local-mode-map’ should be declared before its referent - Alias for ‘evil-snipe-override-local-mode-map’ should be declared before its referent - Alias for ‘evil-snipe-aliases’ should be declared before its referent --- evil-snipe.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/evil-snipe.el b/evil-snipe.el index 1af9829..4f72219 100755 --- a/evil-snipe.el +++ b/evil-snipe.el @@ -137,6 +137,8 @@ search contains capital letters." :group 'evil-snipe :type 'boolean) +(define-obsolete-variable-alias 'evil-snipe-symbol-groups 'evil-snipe-aliases "v2.0.0") + (defcustom evil-snipe-aliases '() "A list of characters mapped to regexps '(CHAR REGEX). If CHAR is used in a snipe, it will be replaced with REGEX. These aliases apply @@ -149,7 +151,6 @@ globally. To set an alias for a specific mode use: :group 'evil-snipe :type '(repeat (cons (character :tag "Key") (regexp :tag "Pattern")))) -(define-obsolete-variable-alias 'evil-snipe-symbol-groups 'evil-snipe-aliases "v2.0.0") (defcustom evil-snipe-disabled-modes '(org-agenda-mode magit-mode git-rebase-mode elfeed-show-mode @@ -583,6 +584,7 @@ explicitly choose the function names." ;;;###autoload (autoload 'evil-snipe-T "evil-snipe" nil t) (evil-snipe-def 1 'exclusive "t" "T") +(define-obsolete-variable-alias 'evil-snipe-mode-map 'evil-snipe-local-mode-map "2.0.8") (defvar evil-snipe-local-mode-map (let ((map (make-sparse-keymap))) @@ -600,6 +602,8 @@ explicitly choose the function names." "X" #'evil-snipe-X)) map)) +(define-obsolete-variable-alias 'evil-snipe-override-mode-map 'evil-snipe-override-local-mode-map "2.0.8") + (defvar evil-snipe-override-local-mode-map (let ((map (make-sparse-keymap))) (evil-define-key* 'motion map @@ -666,8 +670,5 @@ explicitly choose the function names." (define-globalized-minor-mode evil-snipe-override-mode evil-snipe-override-local-mode turn-on-evil-snipe-override-mode) -(define-obsolete-variable-alias 'evil-snipe-mode-map 'evil-snipe-local-mode-map "2.0.8") -(define-obsolete-variable-alias 'evil-snipe-override-mode-map 'evil-snipe-override-local-mode-map "2.0.8") - (provide 'evil-snipe) ;;; evil-snipe.el ends here From 646e8d462b3e6556626a44acb2c1fb3a686b03b7 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 24 Nov 2024 00:34:52 -0500 Subject: [PATCH 07/12] Fix: Docstring wider than 80 characters --- evil-snipe.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/evil-snipe.el b/evil-snipe.el index 4f72219..ae5221b 100755 --- a/evil-snipe.el +++ b/evil-snipe.el @@ -525,7 +525,7 @@ is the transient map to activate afterwards." last-keys last-keymap)))) (evil-define-motion evil-snipe-repeat-reverse (count) - "Repeat the inverse of the last evil-snipe `count' times" + "Repeat the inverse of the last evil-snipe `count' times." (interactive "") (evil-snipe-repeat (or (and (integerp count) (- count)) -1))) @@ -542,7 +542,8 @@ explicitly choose the function names." `(progn (evil-define-motion ,forward-fn (count keys) ,(concat "Jumps to the next " (int-to-string n) - "-char match COUNT matches away. Including KEYS is a list of character codes.") + "-char match COUNT matches away. +Including KEYS is a list of character codes.") :jump t (interactive (let ((count (if current-prefix-arg (prefix-numeric-value current-prefix-arg)))) From 565b1e1edb1a0ddfa4405d81aa28eb05b8a9a602 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 24 Nov 2024 00:40:10 -0500 Subject: [PATCH 08/12] Fix: First line is not a complete sentence --- evil-snipe.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/evil-snipe.el b/evil-snipe.el index ae5221b..17c59f0 100755 --- a/evil-snipe.el +++ b/evil-snipe.el @@ -174,14 +174,14 @@ evil-exchange or anything else. MUST BE SET BEFORE EVIL-SNIPE IS LOADED.") (defcustom evil-snipe-skip-leading-whitespace t - "If non-nil, single char sniping (f/F/t/T) will skip over leading whitespaces -in a line (when you snipe for whitespace, e.g. f or f)." + "If non-nil, single char sniping (f/F/t/T) will skip over leading whitespaces. +(when you snipe for whitespace, e.g. f or f)." :group 'evil-snipe :type 'boolean) (defcustom evil-snipe-tab-increment nil - "If non-nil, pressing TAB while sniping will add another character to your -current search. For example, typing sab will search for 'ab'. In order to search + "If non-nil, pressing TAB while sniping adds another character to the search. +For example, typing sab will search for 'ab'. In order to search for 'abcd', you do sabcd. If nil, TAB will search for literal tab characters." @@ -189,8 +189,8 @@ If nil, TAB will search for literal tab characters." :type 'boolean) (defcustom evil-snipe-char-fold nil - "If non-nil, uses `char-fold-to-regexp' to include other ascii variants of a -search string. CURRENTLY EXPERIMENTAL. + "Non-nil to use `char-fold-to-regexp' to include ASCII variants search string. +CURRENTLY EXPERIMENTAL. e.g. The letter 'a' will match all of its accented cousins, even those composed of multiple characters, as well as many other symbols like U+249C (PARENTHESIZED From d31aec80f61a926dbb2027af07b76f0688221a99 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 9 Mar 2025 12:41:14 -0400 Subject: [PATCH 09/12] =?UTF-8?q?Fix:=20Warning:=20Unused=20lexical=20argu?= =?UTF-8?q?ment=20=E2=80=98count=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- evil-snipe.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evil-snipe.el b/evil-snipe.el index 17c59f0..64b0095 100755 --- a/evil-snipe.el +++ b/evil-snipe.el @@ -339,8 +339,8 @@ If FIRST-P is t, then use `evil-snipe-first-p-match-face'" 'evil-snipe-matches-face)) overlay)) -(defun evil-snipe--highlight-all (count forward-p data) - "Highlight instances of keys in DATA at COUNT intervals. +(defun evil-snipe--highlight-all (_count forward-p data) + "Highlight instances of keys in DATA intervals. Goes backward if FORWARD-P is nil." (let ((case-fold-search (evil-snipe--case-p data)) (match (mapconcat #'cdr data "")) From d41b4e3a4bb600e2f80328bb09d0b213362f2567 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 9 Mar 2025 12:47:42 -0400 Subject: [PATCH 10/12] Fix warnings: Docstring has wrong usage of unescaped single quotes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - evil-snipe.el:72:12: Warning: custom-declare-variable ‘evil-snipe-scope’ docstring has wrong usage of unescaped single quotes (use \=' or different quoting such as `...') - evil-snipe.el:123:12: Warning: custom-declare-variable ‘evil-snipe-show-prompt’ docstring has wrong usage of unescaped single quotes (use \=' or different quoting such as `...') - evil-snipe.el:142:12: Warning: custom-declare-variable ‘evil-snipe-aliases’ docstring has wrong usage of unescaped single quotes (use \=' or different quoting such as `...') - evil-snipe.el:182:12: Warning: custom-declare-variable ‘evil-snipe-tab-increment’ docstring has wrong usage of unescaped single quotes (use \=' or different quoting such as `...') - evil-snipe.el:191:12: Warning: custom-declare-variable ‘evil-snipe-char-fold’ docstring has wrong usage of unescaped single quotes (use \=' or different quoting such as `...') --- evil-snipe.el | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/evil-snipe.el b/evil-snipe.el index 64b0095..6b78cf2 100755 --- a/evil-snipe.el +++ b/evil-snipe.el @@ -72,18 +72,18 @@ for repeating snipes." (defcustom evil-snipe-scope 'line "Dictates the scope of searches, which can be one of: -'line +\='line Search line after the cursor (this is vim-seek behavior) (default) -'buffer +\='buffer Search rest of the buffer after the cursor (vim-sneak behavior) -'visible +\='visible Search rest of visible buffer (Is more performant than 'buffer, but will not highlight/jump past the visible buffer) -'whole-line +\='whole-line Same as 'line, but highlight matches on either side of cursor -'whole-buffer +\='whole-buffer Same as 'buffer, but highlight *all* matches in buffer -'whole-visible +\='whole-visible Same as 'visible, but highlight *all* visible matches in buffer See `evil-snipe-repeat-scope' to change scope only when repeating snipes. @@ -121,7 +121,7 @@ If `evil-snipe-override-evil' is non-nil, this applies to f/F/t/T as well." :type 'boolean) (defcustom evil-snipe-show-prompt t - "If non-nil, show 'N>' prompt while sniping." + "If non-nil, show N> prompt while sniping." :group 'evil-snipe :type 'boolean) @@ -140,14 +140,14 @@ search contains capital letters." (define-obsolete-variable-alias 'evil-snipe-symbol-groups 'evil-snipe-aliases "v2.0.0") (defcustom evil-snipe-aliases '() - "A list of characters mapped to regexps '(CHAR REGEX). + "A list of characters mapped to regexps \='(CHAR REGEX). If CHAR is used in a snipe, it will be replaced with REGEX. These aliases apply globally. To set an alias for a specific mode use: - (add-hook 'c++-mode-hook + (add-hook \='c++-mode-hook (lambda () - (make-local-variable 'evil-snipe-aliases) - (push '(?\[ \"[[{(]\") evil-snipe-aliases)))" + (make-local-variable \='evil-snipe-aliases) + (push \='(?\[ \"[[{(]\") evil-snipe-aliases)))" :group 'evil-snipe :type '(repeat (cons (character :tag "Key") (regexp :tag "Pattern")))) @@ -181,8 +181,8 @@ MUST BE SET BEFORE EVIL-SNIPE IS LOADED.") (defcustom evil-snipe-tab-increment nil "If non-nil, pressing TAB while sniping adds another character to the search. -For example, typing sab will search for 'ab'. In order to search -for 'abcd', you do sabcd. +For example, typing sab will search for \='ab\='. In order to search +for \='abcd\=', you do sabcd. If nil, TAB will search for literal tab characters." :group 'evil-snipe @@ -192,7 +192,7 @@ If nil, TAB will search for literal tab characters." "Non-nil to use `char-fold-to-regexp' to include ASCII variants search string. CURRENTLY EXPERIMENTAL. -e.g. The letter 'a' will match all of its accented cousins, even those composed +e.g. The letter \='a\=' will match all of its accented cousins, even those composed of multiple characters, as well as many other symbols like U+249C (PARENTHESIZED LATIN SMALL LETTER A). From d26af6e0e6cde4696fe1dc31f8f6de91a3be8a20 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 15 Jul 2026 13:36:37 -0400 Subject: [PATCH 11/12] Fix byte-compiler warnings and errors - Rename keymap to evil-snipe-keymap and declare it dynamically to fix prefix warning and lexical binding scope - Add evil-snipe- prefix to turn-on/off override functions - Capitalize package summary and add standard keywords - Fix unescaped single quotes and column 0 parentheses in docstrings - Wrap evil-snipe-char-fold docstring to 80 characters - Add missing docstrings to internal functions and format arguments - Add forward declarations for evil-snipe-(override-)local-mode --- evil-snipe.el | 70 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/evil-snipe.el b/evil-snipe.el index 6b78cf2..9048e81 100755 --- a/evil-snipe.el +++ b/evil-snipe.el @@ -1,4 +1,4 @@ -;;; evil-snipe.el --- emulate vim-sneak & vim-seek -*- lexical-binding: t; -*- +;;; evil-snipe.el --- Emulate vim-sneak & vim-seek -*- lexical-binding: t; -*- ;; ;; Copyright (C) 2014-20 Henrik Lissner ;; @@ -7,7 +7,7 @@ ;; Created: December 5, 2014 ;; Modified: August 21, 2023 ;; Version: 2.1.3 -;; Keywords: emulation, vim, evil, sneak, seek +;; Keywords: convenience, emulations, vim, evil, sneak, seek ;; Homepage: https://github.com/hlissner/evil-snipe ;; Package-Requires: ((emacs "25.1") (evil "1.2.12") (cl-lib "0.5")) ;; @@ -77,14 +77,14 @@ for repeating snipes." \='buffer Search rest of the buffer after the cursor (vim-sneak behavior) \='visible - Search rest of visible buffer (Is more performant than 'buffer, but will not + Search rest of visible buffer (Is more performant than \='buffer, but will not highlight/jump past the visible buffer) \='whole-line - Same as 'line, but highlight matches on either side of cursor + Same as \='line, but highlight matches on either side of cursor \='whole-buffer - Same as 'buffer, but highlight *all* matches in buffer + Same as \='buffer, but highlight *all* matches in buffer \='whole-visible - Same as 'visible, but highlight *all* visible matches in buffer + Same as \='visible, but highlight *all* visible matches in buffer See `evil-snipe-repeat-scope' to change scope only when repeating snipes. @@ -175,7 +175,8 @@ MUST BE SET BEFORE EVIL-SNIPE IS LOADED.") (defcustom evil-snipe-skip-leading-whitespace t "If non-nil, single char sniping (f/F/t/T) will skip over leading whitespaces. -(when you snipe for whitespace, e.g. f or f)." +It skips leading whitespaces when you snipe for whitespace, +e.g. f or f." :group 'evil-snipe :type 'boolean) @@ -192,9 +193,9 @@ If nil, TAB will search for literal tab characters." "Non-nil to use `char-fold-to-regexp' to include ASCII variants search string. CURRENTLY EXPERIMENTAL. -e.g. The letter \='a\=' will match all of its accented cousins, even those composed -of multiple characters, as well as many other symbols like U+249C (PARENTHESIZED -LATIN SMALL LETTER A). +e.g. The letter \='a\=' will match all of its accented cousins, even those +composed of multiple characters, as well as many other symbols like +U+249C (PARENTHESIZED LATIN SMALL LETTER A). Only works in Emacs 25.1+." :group 'evil-snipe @@ -211,6 +212,8 @@ Can be let-bound to create motions that search for N characters. Do not set directly, unless you want to change the default number of characters to search.") (defvar evil-snipe--transient-map-func nil) +(defvar evil-snipe-keymap nil + "Keymap for transient state.") (defvar evil-snipe-parent-transient-map (let ((map (make-sparse-keymap))) @@ -240,6 +243,7 @@ search.") (not (string-match-p "[A-Z]" (mapconcat #'cdr data "")))))) (defun evil-snipe--process-key (key) + "Process KEY to return a cons cell of keystr and its regexp." (let ((keystr (char-to-string key))) (cons keystr (cond ((car (cdr (assoc key evil-snipe-aliases)))) (evil-snipe-char-fold (char-fold-to-regexp keystr)) @@ -369,6 +373,9 @@ Goes backward if FORWARD-P is nil." overlays))))))) overlays)) +(defvar evil-snipe-local-mode) +(defvar evil-snipe-override-local-mode) + (defun evil-snipe--cleanup () "Disable overlays and clean up after evil-snipe." (when (or evil-snipe-local-mode evil-snipe-override-local-mode) @@ -382,6 +389,7 @@ Goes backward if FORWARD-P is nil." (setq evil-snipe--transient-map-func nil))) (defun evil-snipe--transient-map (forward-key backward-key) + "Return a transient map with FORWARD-KEY and BACKWARD-KEY." (let ((map (make-sparse-keymap))) (set-keymap-parent map evil-snipe-parent-transient-map) (when evil-snipe-repeat-keys @@ -392,8 +400,8 @@ Goes backward if FORWARD-P is nil." (defun evil-snipe-seek (count keys &optional keymap) "Perform a snipe with KEYS at COUNT intervals. -KEYS is a list of characters provided by <-c> and <+c> interactive codes. KEYMAP -is the transient map to activate afterwards." +KEYS is a list of characters provided by <-c> and <+c> interactive codes. +KEYMAP is the transient map to activate afterwards." (pcase keys (`abort (setq evil-inhibit-operator t)) ;; if , repeat last search @@ -407,15 +415,16 @@ is the transient map to activate afterwards." (let ((data (mapcar #'evil-snipe--process-key keys))) (let ((case-fold-search (evil-snipe--case-p data)) (count (or count (if evil-snipe--last-direction 1 -1))) - (keymap (if (keymapp keymap) keymap))) + (evil-snipe-keymap (if (keymapp keymap) keymap))) (unless evil-snipe--last-repeat - (setq evil-snipe--last (list count keys keymap + (setq evil-snipe--last (list count keys evil-snipe-keymap evil-snipe--consume-match evil-snipe--match-count))) (evil-snipe--seek count data) (point)))))) (defun evil-snipe--seek-re (data scope count) + "Search for DATA regex within SCOPE and COUNT." (let ((regex (mapconcat #'cdr data "")) result) (when (and evil-snipe-skip-leading-whitespace @@ -429,7 +438,8 @@ is the transient map to activate afterwards." result)))) (defun evil-snipe--seek (count data &optional internal-p) - "Perform a snipe and adjust cursor position depending on mode." + "Perform a snipe using COUNT and DATA, adjusting cursor position. +INTERNAL-P is non-nil if this is an internal call." (let ((orig-point (point)) (forward-p (> count 0))) ;; Adjust search starting point @@ -476,10 +486,10 @@ is the transient map to activate afterwards." (when evil-snipe-enable-highlight (evil-snipe--highlight beg end t))) ;; Activate the repeat keymap - (when (and (boundp 'keymap) keymap) + (when (and (boundp 'evil-snipe-keymap) evil-snipe-keymap) (evil-snipe--disable-transient-map) (setq evil-snipe--transient-map-func - (set-transient-map keymap)))))) + (set-transient-map evil-snipe-keymap)))))) ;; Try to "spill over" into new scope on failed search (evil-snipe-spillover-scope @@ -491,10 +501,10 @@ is the transient map to activate afterwards." ;; If, at last, it fails... (t (goto-char orig-point) - (when (and evil-snipe--last-repeat (boundp 'keymap) keymap) + (when (and evil-snipe--last-repeat (boundp 'evil-snipe-keymap) evil-snipe-keymap) (evil-snipe--disable-transient-map) (setq evil-snipe--transient-map-func - (set-transient-map keymap))) + (set-transient-map evil-snipe-keymap))) (user-error "Can't find %s" ; show invisible keys (replace-regexp-in-string "\t" "" @@ -619,33 +629,35 @@ Including KEYS is a list of character codes.") map)) ;;;###autoload -(defun turn-on-evil-snipe-mode () - "Enable evil-snipe-mode in the current buffer." +(defun evil-snipe-turn-on-mode () + "Enable `evil-snipe-mode' in the current buffer." (unless (apply #'derived-mode-p evil-snipe-disabled-modes) (evil-snipe-local-mode +1))) ;;;###autoload -(defun turn-on-evil-snipe-override-mode () - "Enable evil-snipe-mode in the current buffer." +(defun evil-snipe-turn-on-override-mode () + "Enable `evil-snipe-override-mode' in the current buffer." (unless (apply #'derived-mode-p evil-snipe-disabled-modes) (evil-snipe-override-local-mode +1))) ;;;###autoload -(defun turn-off-evil-snipe-mode () +(defun evil-snipe-turn-off-mode () "Disable `evil-snipe-local-mode' in the current buffer." (evil-snipe-local-mode -1)) ;;;###autoload -(defun turn-off-evil-snipe-override-mode () - "Disable evil-snipe-override-mode in the current buffer." +(defun evil-snipe-turn-off-override-mode () + "Disable `evil-snipe-override-local-mode' in the current buffer." (evil-snipe-override-local-mode -1)) (when (fboundp 'advice-add) (advice-add #'evil-force-normal-state :before #'evil-snipe--cleanup)) (add-hook 'evil-insert-state-entry-hook #'evil-snipe--disable-transient-map) -(defvar evil-snipe--keymaps-init nil) +(defvar evil-snipe--keymaps-init nil + "Non-nil if keymaps are initialized.") (defun evil-snipe--normalize-keymaps () + "Normalize keymaps." (unless evil-snipe--keymaps-init (set (make-local-variable 'evil-snipe--keymaps-init) (and (evil-normalize-keymaps) t)))) @@ -665,11 +677,11 @@ Including KEYS is a list of character codes.") ;;;###autoload (define-globalized-minor-mode evil-snipe-mode - evil-snipe-local-mode turn-on-evil-snipe-mode) + evil-snipe-local-mode evil-snipe-turn-on-mode) ;;;###autoload (define-globalized-minor-mode evil-snipe-override-mode - evil-snipe-override-local-mode turn-on-evil-snipe-override-mode) + evil-snipe-override-local-mode evil-snipe-turn-on-override-mode) (provide 'evil-snipe) ;;; evil-snipe.el ends here From 0b5c99aa68c86e1478aa8d27e012a3231b903020 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 15 Jul 2026 13:44:02 -0400 Subject: [PATCH 12/12] Add .nosearch to the test/ directory --- test/.nosearch | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/.nosearch diff --git a/test/.nosearch b/test/.nosearch new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/test/.nosearch @@ -0,0 +1 @@ +