branch: scratch/evil commit 8c8a6cd493dbe93da03ad7c2887cb0d15fa7eec6 Author: Stefan Monnier <monn...@iro.umontreal.ca> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
Misc minor changes * evil-command-window.el (evil-command-window-draw-prefix): Mark `ignored` as, well, ignored. * README.md: Mention that `undo-fu` is also in NonGNU ELPA. * evil-core (evil-get-auxiliary-keymap): Simplify `vconcat` to `vector`. (evil-auxiliary-keymap-p): Unhide arg by moving it to its own line. * evil-macros.el (evil-define-interactive-code): Move shared `setq func` out of `cond`. Move the insertion of quote around `func` to the `cond` so the `quote` is not incorrectly added around lambda forms. * evil-tests.el: Add a few FIXMEs. * evil-commands.el (evil-save-side-windows): Silence spurious warning. --- README.md | 2 +- evil-command-window.el | 2 +- evil-commands.el | 5 ++++- evil-core.el | 1 + evil-macros.el | 18 +++++++++--------- evil-tests.el | 5 +++++ 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 198b18317c..6473ba66f2 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ file. * The [undo-tree](https://gitlab.com/tsc25/undo-tree) package (available via GNU ELPA) * The [undo-fu](https://gitlab.com/ideasman42/emacs-undo-fu) package - (available via MELPA) + (available via MELPA and NonGNU ELPA) * For the motions `g;` `g,` and for the last-change-register `.`, Evil requires the [goto-chg.el](https://github.com/emacs-evil/goto-chg) diff --git a/evil-command-window.el b/evil-command-window.el index 21299a2dc0..566ee3a79e 100644 --- a/evil-command-window.el +++ b/evil-command-window.el @@ -164,7 +164,7 @@ function to execute." (push result evil-search-backward-history))) (evil-search result forward evil-regexp-search)))) -(defun evil-command-window-draw-prefix (&rest ignored) +(defun evil-command-window-draw-prefix (&rest _ignored) "Display `evil-command-window-cmd-key' as a prefix to the current line. Parameters passed in through IGNORED are ignored." (let ((prefix (propertize evil-command-window-cmd-key diff --git a/evil-commands.el b/evil-commands.el index 71feced938..550eccfb05 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -4494,8 +4494,11 @@ The \"!\" argument means to sort in reverse order." "Toggle side windows, evaluate BODY, restore side windows." (declare (indent defun) (debug (&rest form))) (let ((sides (make-symbol "sidesvar"))) - `(let ((,sides (and (functionp 'window-toggle-side-windows) + `(let ((,sides (and (fboundp 'window-toggle-side-windows) (window-with-parameter 'window-side)))) + ;; The compiler doesn't understand that all uses are protected + ;; by `fboundp' :-( + (declare-function window-toggle-side-windows "window") (when ,sides (window-toggle-side-windows)) (unwind-protect diff --git a/evil-core.el b/evil-core.el index a2214f20ac..efeb441c4d 100644 --- a/evil-core.el +++ b/evil-core.el @@ -128,6 +128,7 @@ (add-hook 'input-method-deactivate-hook #'evil-deactivate-input-method t t) (add-hook 'activate-mark-hook 'evil-visual-activate-hook nil t) ;; FIXME: Add these hooks buffer-locally + ;; FIXME: Remove them when evil is disabled. (add-hook 'pre-command-hook 'evil-repeat-pre-hook) (add-hook 'post-command-hook 'evil-repeat-post-hook)) (evil-refresh-mode-line) diff --git a/evil-macros.el b/evil-macros.el index b8ac87047a..cdf1fc4550 100644 --- a/evil-macros.el +++ b/evil-macros.el @@ -750,19 +750,19 @@ via KEY-VALUE pairs. BODY should evaluate to a list of values. (while (keywordp (car-safe body)) (setq properties (append properties (list (pop body) (pop body))))) - (cond - (args - (setq func `(lambda ,args + (setq func (cond + (args + `(lambda ,args ,@(when doc `(,doc)) - ,@body))) - ((> (length body) 1) - (setq func `(progn ,@body))) - (t - (setq func (car body)))) + ,@body)) + ((> (length body) 1) + `'(progn ,@body)) + (t + `',(car body)))) `(eval-and-compile (let* ((code ,code) (entry (assoc code evil-interactive-alist)) - (value (cons ',func ',properties))) + (value (cons ,func ',properties))) (if entry (setcdr entry value) (push (cons code value) evil-interactive-alist)) diff --git a/evil-tests.el b/evil-tests.el index ac5d5eb207..bb6ec54ba0 100644 --- a/evil-tests.el +++ b/evil-tests.el @@ -61,6 +61,7 @@ ;; ;; This file is NOT part of Evil itself. +;; FIXME: Merely loading an ELisp file should not change Emacs's config! (setq load-prefer-newer t) (require 'cl-lib) @@ -8971,6 +8972,10 @@ parameter set." (ert-deftest evil-test-parser () "Test `evil-parser'" (cl-flet ((parse + ;; FIXME: `evil-parser' is defined in `evil-ex' which is known to + ;; loaded at this point (thanks to (require 'evil)), but that file + ;; defines `evil-parser' only inside an `eval-when-compile', + ;; So this will misbehave if `evil-ex' has been compiled! (evil-parser '((number "[0-9]+" #'string-to-number) (plus "\\+" #'intern)