diff --git a/evil-core.el b/evil-core.el index c514d175..a5d98521 100644 --- a/evil-core.el +++ b/evil-core.el @@ -177,7 +177,7 @@ To enable Evil globally, do (evil-mode)." ;; the `evil--fundamental-mode' alias, sidestepping the restriction. (if evil-mode (progn - (and (eval-when-compile (version< emacs-version "26.1")) + (and (eval-when-compile (< emacs-major-version 26)) (eq (default-value 'major-mode) #'fundamental-mode) (setq-default major-mode #'evil--fundamental-mode)) (ad-enable-regexp "^evil") diff --git a/evil-ex.el b/evil-ex.el index da4db2f9..023139c6 100644 --- a/evil-ex.el +++ b/evil-ex.el @@ -1137,8 +1137,7 @@ The following symbols have reserved meanings within a grammar: ;; sequence (t (setq func (or func 'list)) - (let (;; (last (car-safe (last rules))) - current results rule) + (let (current results rule) (catch 'done (while rules (setq rule (pop rules) diff --git a/evil-macros.el b/evil-macros.el index 7540b9c0..b04cba5f 100644 --- a/evil-macros.el +++ b/evil-macros.el @@ -594,10 +594,9 @@ RETURN-TYPE is non-nil." ;; Make linewise operator shortcuts. E.g., "d" yields the ;; shortcut "dd", and "g?" yields shortcuts "g??" and "g?g?". (let ((keys (nth 2 (evil-extract-count (this-command-keys))))) - (setq keys (listify-key-sequence keys)) - (dotimes (var (length keys)) + (cl-loop for keys on (listify-key-sequence keys) do (define-key evil-operator-shortcut-map - (vconcat (nthcdr var keys)) #'evil-line-or-visual-line))) + (vconcat keys) #'evil-line-or-visual-line))) ;; read motion from keyboard (setq command (evil-read-motion motion) motion (nth 0 command) diff --git a/evil-test-helpers.el b/evil-test-helpers.el index 7d67c560..888284f1 100644 --- a/evil-test-helpers.el +++ b/evil-test-helpers.el @@ -167,17 +167,16 @@ raised. Remaining forms are evaluated as-is. `(execute-kbd-macro (apply #'vconcat (mapcar #'listify-key-sequence - (mapcar #'eval ',form))))) + (list ,@form))))) ((memq (car-safe form) '(kbd vconcat)) `(execute-kbd-macro ,form)) - (t - form)))) + (t form)))) (if error-symbol `(should-error ,result :type ',error-symbol) result)))) body))) - (and (buffer-name buffer) - (kill-buffer buffer)))))) + (when (buffer-live-p buffer) + (kill-buffer buffer)))))) (defmacro evil-test-selection (string &optional end-string before-predicate after-predicate) diff --git a/evil-tests.el b/evil-tests.el index 73f53049..1dc0624f 100644 --- a/evil-tests.el +++ b/evil-tests.el @@ -202,9 +202,7 @@ with `M-x evil-tests-run'")) "Change state to STATE and check keymaps" (evil-change-state state) (let ((mode (evil-state-property state :mode)) - ;; (keymap (evil-state-property state :keymap t)) (local-mode (evil-state-property state :local)) - ;; (local-keymap (evil-state-property state :local-keymap t)) (tag (evil-state-property state :tag t))) (when (functionp tag) (setq tag (funcall tag))) @@ -9472,26 +9470,26 @@ parameter set." (evil-with-temp-file file-name "" (evil-test-buffer (vconcat "i" file-name [escape]) - (should (not (equal file-name (buffer-file-name (current-buffer))))) + (should (not (equal file-name (buffer-file-name)))) ("gf") - (should (equal file-name (buffer-file-name (current-buffer))))))) + (should (equal file-name (buffer-file-name)))))) (ert-info ("Find file at point (visual state)") (evil-with-temp-file file-name "" (evil-test-buffer (vconcat "iuser@localhost:" file-name "$" [escape]) - (should (not (equal file-name (buffer-file-name (current-buffer))))) + (should (not (equal file-name (buffer-file-name)))) ("0f:lvt$gf") - (should (equal file-name (buffer-file-name (current-buffer))))))) + (should (equal file-name (buffer-file-name)))))) (ert-info ("Find file at point with line number") (let* ((line-number 3) (file-content (make-string (* 2 line-number) ?\n))) (evil-with-temp-file file-name (insert file-content) (evil-test-buffer (vconcat "i" file-name (format ":%d" line-number) [escape]) - (should (and (not (equal file-name (buffer-file-name (current-buffer)))) + (should (and (not (equal file-name (buffer-file-name))) (not (equal line-number (line-number-at-pos))))) ("gF") - (should (and (equal file-name (buffer-file-name (current-buffer))) + (should (and (equal file-name (buffer-file-name)) (equal line-number (line-number-at-pos)))))))) (ert-info ("Find file at point with line and column numbers") (let* ((line-number 3) @@ -9503,11 +9501,11 @@ parameter set." (evil-with-temp-file file-name (insert file-content) (evil-test-buffer (vconcat "i" file-name (format ":%d:%d" line-number column-number) [escape]) - (should (and (not (equal file-name (buffer-file-name (current-buffer)))) + (should (and (not (equal file-name (buffer-file-name))) (not (equal line-number (line-number-at-pos))) (not (equal column-number (current-column))))) ("gF") - (should (and (equal file-name (buffer-file-name (current-buffer))) + (should (and (equal file-name (buffer-file-name)) (equal line-number (line-number-at-pos)) (equal column-number (1+ (current-column)))))))))) diff --git a/evil.el b/evil.el index 1028a58e..e4e3bd50 100644 --- a/evil.el +++ b/evil.el @@ -1,4 +1,4 @@ -;;; evil.el --- Extensible Vi layer for Emacs -*- lexical-binding: t; -*- +;;; evil.el --- Extensible vi layer for Emacs -*- lexical-binding: t; -*- ;; The following list of authors was kept up to date until the beginning of ;; 2017, when evil moved under new maintainers. For authors since then, please