diff options
| -rw-r--r-- | evil-command-window.el | 27 | ||||
| -rw-r--r-- | evil-commands.el | 49 | ||||
| -rw-r--r-- | evil-common.el | 58 | ||||
| -rw-r--r-- | evil-core.el | 3 | ||||
| -rw-r--r-- | evil-ex.el | 11 | ||||
| -rw-r--r-- | evil-integration.el | 10 | ||||
| -rw-r--r-- | evil-jumps.el | 12 | ||||
| -rw-r--r-- | evil-macros.el | 10 | ||||
| -rw-r--r-- | evil-repeat.el | 2 | ||||
| -rw-r--r-- | evil-search.el | 28 | ||||
| -rw-r--r-- | evil-states.el | 9 | ||||
| -rw-r--r-- | evil-vars.el | 12 |
12 files changed, 110 insertions, 121 deletions
diff --git a/evil-command-window.el b/evil-command-window.el index 379e556..91cc5b6 100644 --- a/evil-command-window.el +++ b/evil-command-window.el @@ -69,14 +69,35 @@ execute on the result that the user selects." (evil-command-window-mode) (evil-command-window-insert-commands hist)) -(defun evil-command-window-ex (&optional current-command) +(defun evil-command-window-ex (&optional current-command execute-fn) "Open a command line window for editing and executing ex commands. If CURRENT-COMMAND is present, it will be inserted under the -cursor as the current command to be edited." +cursor as the current command to be edited. If EXECUTE-FN is given, +it will be used as the function to execute instead of +`evil-command-window-ex-execute', the default." (interactive) (evil-command-window (cons (or current-command "") evil-ex-history) ":" - 'evil-command-window-ex-execute)) + (or execute-fn 'evil-command-window-ex-execute))) + +(defun evil-ex-command-window () + "Start command window with ex history and current minibuffer content." + (interactive) + (let ((current (minibuffer-contents)) + (config (current-window-configuration))) + (evil-ex-teardown) + (select-window (minibuffer-selected-window) t) + (evil-ex-command-window current (apply-partially 'evil-ex-command-window-execute config)))) + +(defun evil-ex-search-command-window () + "Start command window with search history and current minibuffer content." + (interactive) + (let ((current (minibuffer-contents)) + (config (current-window-configuration))) + (select-window (minibuffer-selected-window) t) + (evil-command-window (cons current evil-ex-search-history) + (evil-search-prompt (eq evil-ex-search-direction 'forward)) + (apply-partially 'evil-ex-command-window-execute config)))) (defun evil-command-window-execute () "Execute the command under the cursor in the appropriate buffer. diff --git a/evil-commands.el b/evil-commands.el index 8482048..8d41650 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -160,7 +160,7 @@ of the line or the buffer; just return nil." ;; Catch bob and eob errors. These are caused when not moving ;; point starting in the first or last line, respectively. In this ;; case the current line should be selected. - (condition-case err + (condition-case _err (evil-line-move (1- (or count 1))) ((beginning-of-buffer end-of-buffer))))) @@ -172,7 +172,7 @@ of the line or the buffer; just return nil." ;; Catch bob and eob errors. These are caused when not moving ;; point starting in the first or last line, respectively. In this ;; case the current line should be selected. - (condition-case err + (condition-case _err (evil-line-move (1- (or count 1))) ((beginning-of-buffer end-of-buffer))))) @@ -450,7 +450,7 @@ If BIGWORD is non-nil, move by WORDS." :type exclusive (evil-signal-at-bob-or-eob count) (evil-forward-nearest count - #'(lambda (cnt) + #'(lambda (_cnt) (evil-forward-beginning 'evil-sentence)) #'evil-forward-paragraph)) @@ -460,9 +460,9 @@ If BIGWORD is non-nil, move by WORDS." :type exclusive (evil-signal-at-bob-or-eob (- (or count 1))) (evil-forward-nearest (- (or count 1)) - #'(lambda (cnt) + #'(lambda (_cnt) (evil-backward-beginning 'evil-sentence)) - #'(lambda (cnt) + #'(lambda (_cnt) (evil-backward-paragraph)))) (evil-define-motion evil-forward-paragraph (count) @@ -482,6 +482,7 @@ If BIGWORD is non-nil, move by WORDS." (evil-backward-beginning 'evil-paragraph count) (unless (bobp) (forward-line -1))) +(defvar hif-ifx-else-endif-regexp) (evil-define-motion evil-jump-item (count) "Find the next item in this line after or under the cursor and jump to the corresponding one." @@ -555,7 +556,6 @@ and jump to the corresponding one." ((not (or open-pair close-pair)) ;; nothing found, check if we are inside a string (let ((pnt (point)) - (state (syntax-ppss (point))) (bnd (bounds-of-thing-at-point 'evil-string))) (if (not (and bnd (< (point) (cdr bnd)))) ;; no, then we really failed @@ -818,6 +818,7 @@ The current position is placed in the jump list." (evil--jump-backward 1) (evil-set-jump pnt))) +(defvar xref-prompt-for-identifier) (evil-define-motion evil-jump-to-tag (arg) "Jump to tag under point. If called with a prefix argument, provide a prompt @@ -1680,7 +1681,7 @@ of the block." (when (> count 1) (setq count (1- count))) (goto-char beg) - (dotimes (var count) + (dotimes (_ count) (join-line 1)))) (evil-define-operator evil-join-whitespace (beg end) @@ -1692,7 +1693,7 @@ but doesn't insert or remove any spaces." (when (> count 1) (setq count (1- count))) (goto-char beg) - (dotimes (var count) + (dotimes (_ count) (evil-move-end-of-line 1) (unless (eobp) (delete-char 1))))) @@ -1954,7 +1955,7 @@ The return value is the yanked text." (setq text (evil-vector-to-string text))) (set-text-properties 0 (length text) nil text) (push-mark opoint t) - (dotimes (i (or count 1)) + (dotimes (_ (or count 1)) (insert-for-yank text)) (setq evil-last-paste (list #'evil-paste-before @@ -2007,7 +2008,7 @@ The return value is the yanked text." ;; The reason is that this yanking could very well use ;; `yank-handler'. (let ((beg (point))) - (dotimes (i (or count 1)) + (dotimes (_ (or count 1)) (insert-for-yank text)) (setq evil-last-paste (list #'evil-paste-after @@ -2175,7 +2176,7 @@ when called interactively." (cond ((functionp macro) (evil-repeat-abort) - (dotimes (i (or count 1)) + (dotimes (_ (or count 1)) (funcall macro))) ((or (and (not (stringp macro)) (not (vectorp macro))) @@ -2683,14 +2684,14 @@ for `isearch-forward',\nwhich lists available keys:\n\n%s" (evil-search search-string isearch-forward evil-regexp-search)) (point))) (when (and count (> count 1)) - (dotimes (var (1- count)) + (dotimes (_ (1- count)) (evil-search search-string isearch-forward evil-regexp-search))))) (evil-define-motion evil-search-previous (count) "Repeat the last search in the opposite direction." :jump t :type exclusive - (dotimes (var (or count 1)) + (dotimes (_ (or count 1)) (evil-search (if evil-regexp-search (car-safe regexp-search-ring) (car-safe search-ring)) @@ -2702,7 +2703,7 @@ for `isearch-forward',\nwhich lists available keys:\n\n%s" :type exclusive (interactive (list (prefix-numeric-value current-prefix-arg) evil-symbol-word-search)) - (dotimes (var (or count 1)) + (dotimes (_ (or count 1)) (evil-search-word nil nil symbol))) (evil-define-motion evil-search-word-forward (count &optional symbol) @@ -2711,7 +2712,7 @@ for `isearch-forward',\nwhich lists available keys:\n\n%s" :type exclusive (interactive (list (prefix-numeric-value current-prefix-arg) evil-symbol-word-search)) - (dotimes (var (or count 1)) + (dotimes (_ (or count 1)) (evil-search-word t nil symbol))) (evil-define-motion evil-search-unbounded-word-backward (count &optional symbol) @@ -2722,7 +2723,7 @@ The search is unbounded, i.e., the pattern is not wrapped in :type exclusive (interactive (list (prefix-numeric-value current-prefix-arg) evil-symbol-word-search)) - (dotimes (var (or count 1)) + (dotimes (_ (or count 1)) (evil-search-word nil t symbol))) (evil-define-motion evil-search-unbounded-word-forward (count &optional symbol) @@ -2733,7 +2734,7 @@ The search is unbounded, i.e., the pattern is not wrapped in :type exclusive (interactive (list (prefix-numeric-value current-prefix-arg) evil-symbol-word-search)) - (dotimes (var (or count 1)) + (dotimes (_ (or count 1)) (evil-search-word t t symbol))) (defun evil-goto-definition-imenu (string _position) @@ -2992,14 +2993,14 @@ command." "Goes to the `count'-th next buffer in the buffer list." :repeat nil (interactive "p") - (dotimes (i (or count 1)) + (dotimes (_ (or count 1)) (next-buffer))) (evil-define-command evil-prev-buffer (&optional count) "Goes to the `count'-th prev buffer in the buffer list." :repeat nil (interactive "p") - (dotimes (i (or count 1)) + (dotimes (_ (or count 1)) (previous-buffer))) (evil-define-command evil-delete-buffer (buffer &optional bang) @@ -3495,7 +3496,6 @@ reveal.el. OPEN-SPOTS is a local version of `reveal-open-spots'." (evil-ex-substitute-last-point (point)) (whole-line (evil-ex-pattern-whole-line pattern)) (evil-ex-substitute-overlay (make-overlay (point) (point))) - (evil-ex-substitute-hl (evil-ex-make-hl 'evil-ex-substitute)) (orig-point-marker (move-marker (make-marker) (point))) (end-marker (move-marker (make-marker) end)) (use-reveal confirm) @@ -3798,6 +3798,7 @@ Default position is the beginning of the buffer." (message "\"%s\" %d %slines --%s--" file nlines readonly perc) (message "%d lines --%s--" nlines perc)))) +(defvar sort-fold-case) (evil-define-operator evil-ex-sort (beg end &optional options reverse) "The Ex sort command. \[BEG,END]sort[!] [i][u] @@ -3981,28 +3982,28 @@ of the parent of the splitted window are rebalanced." "Move the cursor to new COUNT-th window left of the current one." :repeat nil (interactive "p") - (dotimes (i count) + (dotimes (_ count) (windmove-left))) (evil-define-command evil-window-right (count) "Move the cursor to new COUNT-th window right of the current one." :repeat nil (interactive "p") - (dotimes (i count) + (dotimes (_ count) (windmove-right))) (evil-define-command evil-window-up (count) "Move the cursor to new COUNT-th window above the current one." :repeat nil (interactive "p") - (dotimes (i (or count 1)) + (dotimes (_ (or count 1)) (windmove-up))) (evil-define-command evil-window-down (count) "Move the cursor to new COUNT-th window below the current one." :repeat nil (interactive "p") - (dotimes (i (or count 1)) + (dotimes (_ (or count 1)) (windmove-down))) (evil-define-command evil-window-bottom-right () diff --git a/evil-common.el b/evil-common.el index 33110fd..3f6eb76 100644 --- a/evil-common.el +++ b/evil-common.el @@ -156,8 +156,8 @@ Elements are compared with `eq'." (let (result) (dolist (sequence sequences) (dolist (elt sequence) - (add-to-list 'result elt nil #'eq))) - (nreverse result))) + (push elt result))) + (nreverse (cl-remove-duplicates result :test #'eq)))) (defun evil-concat-alists (&rest sequences) "Concatenate association lists, removing duplicates. @@ -341,6 +341,7 @@ sorting in between." `(defun ,command ,args ,@(when doc `(,doc)) ,interactive + (ignore ,@(remq '&optional args)) ,@body)) ,(when (and command doc-form) `(put ',command 'function-documentation ,doc-form)) @@ -480,7 +481,7 @@ an empty string." (zerop (length (substring string idx)))) (push match result)))) (when (and num (< (length result) num)) - (dotimes (i (- num (length result))) + (dotimes (_ (- num (length result))) (push nil result))) (nreverse result)))) @@ -560,9 +561,10 @@ Translates it according to the input method." (lookup-key global-map [tab-bar])) (define-key new-global-map [tool-bar] (lookup-key global-map [tool-bar])) - (add-to-list 'new-global-map - (make-char-table 'display-table - 'self-insert-command) t) + (setq new-global-map + (append new-global-map + (list (make-char-table 'display-table + 'self-insert-command)))) (use-global-map new-global-map) (setq seq (read-key-sequence prompt nil t) char (aref seq 0) @@ -625,10 +627,7 @@ HIDE-CHARS characters. HIDE-CHARS defaults to 1." The type may be overridden with MODIFIER, which may be a type or a Visual selection as defined by `evil-define-visual-selection'. Return a list (MOTION COUNT [TYPE])." - (let ((modifiers '((evil-visual-char . char) - (evil-visual-line . line) - (evil-visual-block . block))) - command prefix) + (let (command prefix) (setq evil-this-type-modified nil) (unless motion (while (progn @@ -1494,7 +1493,6 @@ motion stops when COUNT reaches zero. The match-data reflects the last successful match (that caused COUNT to reach zero)." (let* ((dir (if (> (or count 1) 0) +1 -1)) (count (abs (or count 1))) - (match (> count 0)) (op (if (> dir 0) 1 2)) (cl (if (> dir 0) 2 1)) (orig (point)) @@ -2012,7 +2010,7 @@ or a marker object pointing nowhere." (marker-position (cdr entry)))))))) (put 'evil-swap-out-markers 'permanent-local-hook t) -(defun evil-get-register (register &optional noerror) +(defun evil-get-register (register &optional _noerror) "Return contents of REGISTER. Signal an error if empty, unless NOERROR is non-nil. @@ -2627,7 +2625,7 @@ The tracked insertion is set to `evil-last-insertion'." (col (if (eq last-command 'evil-paste-after) (1+ (current-column)) (current-column)))) - (dotimes (i nrows) + (dotimes (_ nrows) (delete-region (save-excursion (move-to-column col) (point)) @@ -3083,7 +3081,7 @@ linewise, otherwise it is character wise." ;; possibly count current object as selection (if addcurrent (setq count (1- count))) ;; move - (dotimes (var count) + (dotimes (_ count) (let ((wsend (evil-bounds-of-not-thing-at-point thing dir))) (if (and wsend (/= wsend (point))) ;; start with whitespace @@ -3296,7 +3294,7 @@ is ignored." (evil-up-block open close cnt)) beg end type count inclusive)))) -(defun evil-select-quote-thing (thing beg end type count &optional inclusive) +(defun evil-select-quote-thing (thing beg end _type count &optional inclusive) "Selection THING as if it described a quoted object. THING is typically either 'evil-quote or 'evil-chars. This function is called from `evil-select-quote'." @@ -3305,7 +3303,6 @@ function is called from `evil-select-quote'." (dir (if (> count 0) 1 -1)) (bnd (let ((b (bounds-of-thing-at-point thing))) (and b (< (point) (cdr b)) b))) - contains-string addcurrent wsboth) (if inclusive (setq inclusive t) @@ -3557,21 +3554,20 @@ in `evil-temporary-undo' instead." ;;; Search (defun evil-transform-regexp (regexp replacements-alist) - (let ((pos 0) result) - (replace-regexp-in-string - "\\\\+[^\\\\]" - #'(lambda (txt) - (let* ((b (match-beginning 0)) - (e (match-end 0)) - (ch (aref txt (1- e))) - (repl (assoc ch replacements-alist))) - (if (and repl (zerop (mod (length txt) 2))) - (concat (substring txt b (- e 2)) - (cdr repl)) - txt))) - regexp nil t))) - -(defun evil-transform-magic (str magic quote transform &optional start) + (replace-regexp-in-string + "\\\\+[^\\\\]" + #'(lambda (txt) + (let* ((b (match-beginning 0)) + (e (match-end 0)) + (ch (aref txt (1- e))) + (repl (assoc ch replacements-alist))) + (if (and repl (zerop (mod (length txt) 2))) + (concat (substring txt b (- e 2)) + (cdr repl)) + txt))) + regexp nil t)) + +(defun evil-transform-magic (str magic quote transform &optional _start) "Transforms STR with magic characters. MAGIC is a regexp that matches all potential magic characters. Each occurence of CHAR as magic character within str diff --git a/evil-core.el b/evil-core.el index 09101e4..af32779 100644 --- a/evil-core.el +++ b/evil-core.el @@ -481,8 +481,7 @@ This allows input methods to be used in normal-state." "Initialize a buffer-local value for local keymaps as necessary. The initial value is that of `make-sparse-keymap'." (dolist (entry evil-local-keymaps-alist) - (let ((mode (car entry)) - (map (cdr entry))) + (let ((map (cdr entry))) (unless (and (keymapp (symbol-value map)) (local-variable-p map)) (set map (make-sparse-keymap)))))) @@ -222,17 +222,6 @@ Otherwise behaves like `delete-backward-char'." (unless (minibufferp) (abort-recursive-edit))) -(defun evil-ex-command-window () - "Start command window with ex history and current minibuffer content." - (interactive) - (let ((current (minibuffer-contents)) - (config (current-window-configuration))) - (evil-ex-teardown) - (select-window (minibuffer-selected-window) t) - (evil-command-window (cons current evil-ex-history) - ":" - (apply-partially 'evil-ex-command-window-execute config)))) - (defun evil-ex-command-window-execute (config result) (select-window (active-minibuffer-window) t) (set-window-configuration config) diff --git a/evil-integration.el b/evil-integration.el index 3eac3c5..947f5ab 100644 --- a/evil-integration.el +++ b/evil-integration.el @@ -290,6 +290,7 @@ activated." (declare-function ace-jump-char-mode "ext:ace-jump-mode") (declare-function ace-jump-word-mode "ext:ace-jump-mode") (declare-function ace-jump-line-mode "ext:ace-jump-mode") +(defvar ace-jump-mode-scope) (defvar evil-ace-jump-active nil) @@ -411,6 +412,7 @@ the mark and entering `recursive-edit'." (declare-function avy-goto-subword-0 "ext:avy") (declare-function avy-goto-subword-1 "ext:avy") (declare-function avy-goto-char-timer "ext:avy") +(defvar avy-all-windows) (defmacro evil-enclose-avy-for-motion (&rest body) "Enclose avy to make it suitable for motions. @@ -428,7 +430,7 @@ Based on `evil-enclose-ace-jump-for-motion'." (declare (indent defun) (debug t)) (let ((name (intern (format "evil-%s" command)))) - `(evil-define-motion ,name (_count) + `(evil-define-motion ,name (count) ,(format "Evil motion for `%s'." command) :type ,type :jump t @@ -499,10 +501,8 @@ Based on `evil-enclose-ace-jump-for-motion'." (setq this-command #'digit-argument) (call-interactively #'digit-argument)) (t - (let ((target (or (command-remapping #'evil-beginning-of-visual-line) - #'evil-beginning-of-visual-line))) - (setq this-command 'evil-beginning-of-visual-line) - (call-interactively 'evil-beginning-of-visual-line))))) + (setq this-command 'evil-beginning-of-visual-line) + (call-interactively 'evil-beginning-of-visual-line)))) (evil-define-minor-mode-key 'motion 'visual-line-mode "j" 'evil-next-visual-line diff --git a/evil-jumps.el b/evil-jumps.el index c02de01..53b79bc 100644 --- a/evil-jumps.el +++ b/evil-jumps.el @@ -143,10 +143,7 @@ (unless evil-jumps-cross-buffers ;; skip jump marks pointing to other buffers (while (and (< idx size) (>= idx 0) - (not (string= current-file-name - (let* ((place (ring-ref target-list idx)) - (pos (car place))) - (cadr place))))) + (not (string= current-file-name (cadr (ring-ref target-list idx))))) (setq idx (+ idx shift)))) (when (and (< idx size) (>= idx 0)) ;; actual jump @@ -258,14 +255,13 @@ POS defaults to point." (evil--jumps-push)) (evil--jumps-jump idx -1))))) -(defun evil--jumps-window-configuration-hook (&rest args) +(defun evil--jumps-window-configuration-hook (&rest _args) (let* ((window-list (window-list-1 nil nil t)) (existing-window (selected-window)) (new-window (previous-window))) (when (and (not (eq existing-window new-window)) (> (length window-list) 1)) - (let* ((target-jump-struct (evil--jumps-get-current new-window)) - (target-jump-count (ring-length (evil--jumps-get-jumps target-jump-struct)))) + (let* ((target-jump-struct (evil--jumps-get-current new-window))) (if (not (ring-empty-p (evil--jumps-get-jumps target-jump-struct))) (evil--jumps-message "target window %s already has %s jumps" new-window target-jump-count) (evil--jumps-message "new target window detected; copying %s to %s" existing-window new-window) @@ -275,7 +271,7 @@ POS defaults to point." (setf (evil-jumps-struct-idx target-jump-struct) (evil-jumps-struct-idx source-jump-struct)) (setf (evil-jumps-struct-ring target-jump-struct) (ring-copy source-list))))))) ;; delete obsolete windows - (maphash (lambda (key val) + (maphash (lambda (key _val) (unless (member key window-list) (evil--jumps-message "removing %s" key) (remhash key evil--jumps-window-jumps))) diff --git a/evil-macros.el b/evil-macros.el index 42e18df..74ea0d9 100644 --- a/evil-macros.el +++ b/evil-macros.el @@ -44,7 +44,6 @@ The return value is a list (BEG END TYPE)." (let ((opoint (point)) (omark (mark t)) - (omactive (and (boundp 'mark-active) mark-active)) (obuffer (current-buffer)) (evil-motion-marker (move-marker (make-marker) (point))) range) @@ -131,7 +130,7 @@ Optional keyword arguments are: [&rest keywordp sexp] [&optional ("interactive" [&rest form])] def-body))) - (let (arg doc interactive key keys type) + (let (arg doc interactive key keys) (when args (setq args `(&optional ,@(delq '&optional args)) ;; the count is either numerical or nil @@ -571,7 +570,7 @@ RETURN-TYPE is non-nil." (when evil-ex-p 'evil-line))) (type evil-operator-range-type) (range (evil-range (point) (point))) - command count modifier) + command count) (setq evil-this-type-modified nil) (evil-save-echo-area (cond @@ -692,8 +691,7 @@ be transformations on buffer positions, like `:expand' and `:contract'. string (if (stringp string) (format "%s\n\n" string) "") plist (plist-put plist key `',name)) - (add-to-list - 'defun-forms + (push (cond ((eq key :string) `(defun ,name (beg end &rest properties) @@ -747,7 +745,7 @@ with PROPERTIES.\n\n%s%s" sym type string doc) (setq properties (evil-concat-plists properties plist)) (apply #'evil-range beg end type properties))))))) - t))) + defun-forms))) ;; :one-to-one requires both or neither of :expand and :contract (when (plist-get plist :expand) (setq plist (plist-put plist :one-to-one diff --git a/evil-repeat.el b/evil-repeat.el index 01168c9..75facea 100644 --- a/evil-repeat.el +++ b/evil-repeat.el @@ -407,7 +407,7 @@ buffer between (point) and (mark)." ((eq flag 'post) (remove-hook 'after-change-functions #'evil-repeat-insert-at-point-hook t)))) -(defun evil-repeat-insert-at-point-hook (beg end length) +(defun evil-repeat-insert-at-point-hook (beg end _length) (let ((repeat-type (evil-repeat-type this-command t))) (when (and (evil-repeat-recording-p) (eq repeat-type 'evil-repeat-insert-at-point) diff --git a/evil-search.el b/evil-search.el index 1989cab..26e4448 100644 --- a/evil-search.el +++ b/evil-search.el @@ -116,7 +116,7 @@ to display in the echo area." (let ((lazy-highlight-initial-delay 0) (isearch-search-fun-function 'evil-isearch-function) (isearch-case-fold-search case-fold-search) - (disable #'(lambda (&optional arg) (evil-flash-hook t)))) + (disable #'(lambda (&optional _arg) (evil-flash-hook t)))) (when evil-flash-timer (cancel-timer evil-flash-timer)) (unless (or (null string) @@ -274,9 +274,7 @@ one more than the current position." If FORWARD is nil, search backward, otherwise forward. If SYMBOL is non-nil then the functions searches for the symbol at point, otherwise for the word at point." - (let ((string (car-safe regexp-search-ring)) - (move (if forward #'forward-char #'backward-char)) - (end (if forward #'eobp #'bobp))) + (let ((string (car-safe regexp-search-ring))) (setq isearch-forward forward) (cond ((and (memq last-command @@ -586,7 +584,7 @@ The following properties are supported: pattern)) (evil-ex-hl-idle-update)))) -(defun evil-ex-hl-set-region (name beg end &optional type) +(defun evil-ex-hl-set-region (name beg end &optional _type) "Set minimal and maximal position of highlight NAME to BEG and END." (let ((hl (cdr-safe (assoc name evil-ex-active-highlights-alist)))) (when hl @@ -755,7 +753,7 @@ Note that this function ignores the whole-line property of PATTERN." (evil-ex-hl-update-highlights))) (setq evil-ex-hl-update-timer nil)) -(defun evil-ex-hl-update-highlights-scroll (win beg) +(defun evil-ex-hl-update-highlights-scroll (win _beg) "Update highlights after scrolling in some window." (with-current-buffer (window-buffer win) (evil-ex-hl-idle-update))) @@ -791,7 +789,7 @@ the direcion is determined by `evil-ex-search-direction'." count (or count 1)) (let ((orig (point)) wrapped) - (dotimes (i (or count 1)) + (dotimes (_ (or count 1)) (when (eq evil-ex-search-direction 'forward) (unless (eobp) (forward-char)) ;; maybe skip end-of-line @@ -995,7 +993,7 @@ any error conditions." 'forward 'backward))))))))) -(defun evil-ex-search-update-pattern (beg end range) +(defun evil-ex-search-update-pattern (_beg _end _range) "Update the current search pattern." (save-match-data (let ((pattern-string (minibuffer-contents))) @@ -1043,16 +1041,6 @@ any error conditions." (evil-ex-delete-hl 'evil-ex-search) (abort-recursive-edit)) -(defun evil-ex-search-command-window () - "Start command window with search history and current minibuffer content." - (interactive) - (let ((current (minibuffer-contents)) - (config (current-window-configuration))) - (select-window (minibuffer-selected-window) t) - (evil-command-window (cons current evil-ex-search-history) - (evil-search-prompt (eq evil-ex-search-direction 'forward)) - (apply-partially 'evil-ex-command-window-execute config)))) - (defun evil-ex-search-goto-offset (offset) "Move point according to search OFFSET and set `evil-this-type' accordingly. This function assumes that the current match data represents the @@ -1219,12 +1207,12 @@ This handler highlights the pattern of the current substitution." (evil-ex-pattern-update-ex-info nil (format "%s" lossage)))))))) -(defun evil-ex-pattern-update-ex-info (hl result) +(defun evil-ex-pattern-update-ex-info (_hl result) "Update the Ex info string." (when (stringp result) (evil-ex-echo "%s" result))) -(defun evil-ex-pattern-update-replacement (hl overlay) +(defun evil-ex-pattern-update-replacement (_hl overlay) "Update the replacement display." (when (fboundp 'match-substitute-replacement) (let ((fixedcase (not case-replace)) diff --git a/evil-states.el b/evil-states.el index 9365678..1c65d58 100644 --- a/evil-states.el +++ b/evil-states.el @@ -143,7 +143,7 @@ commands opening a new line." "Called when Insert state is about to be exited. Handles the repeat-count of the insertion command." (when evil-insert-count - (dotimes (i (1- evil-insert-count)) + (dotimes (_ (1- evil-insert-count)) (when evil-insert-lines (evil-insert-newline-below) (when evil-auto-indent @@ -176,7 +176,7 @@ Handles the repeat-count of the insertion command." (if (integerp col) (move-to-column col t) (funcall col)) - (dotimes (i (or evil-insert-count 1)) + (dotimes (_ (or evil-insert-count 1)) (when (fboundp 'evil-execute-repeat-info) (evil-execute-repeat-info (cdr evil-insert-repeat-info))))))))))) @@ -374,7 +374,7 @@ otherwise exit Visual state." evil-visual-beginning evil-visual-end))))))) -(defun evil-visual-activate-hook (&optional command) +(defun evil-visual-activate-hook (&optional _command) "Enable Visual state if the region is activated." (unless (evil-visual-state-p) (evil-delay nil @@ -629,7 +629,6 @@ Do this by putting an overlay on each line within the rectangle. Each overlay extends across all the columns of the rectangle. Reuse overlays where possible to prevent flicker." (let* ((point (point)) - (mark (or (mark t) point)) (overlays (or overlays 'evil-visual-block-overlays)) (old (symbol-value overlays)) (eol-col (and (memq this-command '(next-line previous-line)) @@ -666,7 +665,7 @@ Reuse overlays where possible to prevent flicker." ;; iterate over those lines of the rectangle which are ;; visible in the currently selected window (goto-char window-beg) - (dotimes (i nlines) + (dotimes (_ nlines) (let (before after row-beg row-end) ;; beginning of row (evil-move-to-column beg-col) diff --git a/evil-vars.el b/evil-vars.el index d5bb097..6000f83 100644 --- a/evil-vars.el +++ b/evil-vars.el @@ -91,7 +91,7 @@ KEY must be readable by `read-kbd-macro'." (define-key map key fun) (define-key map old-key nil)))))))) -(defun evil-set-custom-state-maps (var pending-var key make newlist) +(defun evil-set-custom-state-maps (var pending-var key _make newlist) "Changes the list of special keymaps. VAR is the variable containing the list of keymaps. PENDING-VAR is the variable containing the list of the currently pending @@ -108,7 +108,7 @@ NEWLIST the list of new special keymaps." (set-default var newlist) (evil-update-pending-maps)) -(defun evil-update-pending-maps (&optional file) +(defun evil-update-pending-maps (&optional _file) "Tries to set pending special keymaps. This function should be called from an `after-load-functions' hook." @@ -561,7 +561,7 @@ The default behavior is to yank the whole line, like Vim." :group 'evil :type 'boolean :initialize #'evil-custom-initialize-pending-reset - :set #'(lambda (sym value) + :set #'(lambda (_sym value) (evil-add-command-properties 'evil-yank-line :motion (if value @@ -591,6 +591,8 @@ in insert state." :type 'boolean :group 'evil) +(defvar dabbrev-search-these-buffers-only) +(defvar dabbrev-case-distinction) (defcustom evil-complete-next-func #'(lambda (arg) (require 'dabbrev) @@ -902,7 +904,7 @@ should be overridden. If STATE is nil, all states are overridden." :type '(alist :key-type symbol :value-type symbol) :group 'evil - :set #'(lambda (var values) + :set #'(lambda (_var values) (evil-set-custom-state-maps 'evil-overriding-maps 'evil-pending-overriding-maps 'override-state @@ -921,7 +923,7 @@ should be intercepted. If STATE is nil, all states are intercepted." :type '(alist :key-type symbol :value-type symbol) :group 'evil - :set #'(lambda (var values) + :set #'(lambda (_var values) (evil-set-custom-state-maps 'evil-intercept-maps 'evil-pending-intercept-maps 'intercept-state |
