[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] scratch/evil ea1b21d658 8/8: Misc minor changes
From: |
Stefan Monnier |
Subject: |
[nongnu] scratch/evil ea1b21d658 8/8: Misc minor changes |
Date: |
Mon, 3 Jul 2023 11:39:12 -0400 (EDT) |
branch: scratch/evil
commit ea1b21d65843e7f1417fba098898e69946393dc1
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@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 | 3 ++-
evil-macros.el | 18 +++++++++---------
evil-tests.el | 5 +++++
6 files changed, 22 insertions(+), 13 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 f032158ed5..639ac4ac63 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -4523,8 +4523,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 c259f78658..8fdc35081a 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)
@@ -837,7 +838,7 @@ IGNORE-PARENT are non-nil then a new auxiliary
keymap is created even if the parent of MAP has
one already."
(when state
- (let* ((key (vconcat (list (intern (format "%s-state" state)))))
+ (let* ((key (vector (intern (format "%s-state" state))))
(parent-aux (when (and ignore-parent
(keymap-parent map))
(lookup-key (keymap-parent map) key)))
diff --git a/evil-macros.el b/evil-macros.el
index 5027f68612..6d8bb8b9f6 100644
--- a/evil-macros.el
+++ b/evil-macros.el
@@ -751,19 +751,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 999b390940..7bcb9645a2 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)
@@ -8970,6 +8971,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)
- [nongnu] branch scratch/evil created (now ea1b21d658), Stefan Monnier, 2023/07/03
- [nongnu] scratch/evil b04145a776 7/8: Replace uses of `defadvice` with `advice-add`, Stefan Monnier, 2023/07/03
- [nongnu] scratch/evil 675faf080b 5/8: Use lexical-binding everywhere, Stefan Monnier, 2023/07/03
- [nongnu] scratch/evil 17c92495d8 4/8: (evil-with-delay): New macro, extracted from `evil-delay`, Stefan Monnier, 2023/07/03
- [nongnu] scratch/evil b59be16833 1/8: evil-pkg.el: Remove file, Stefan Monnier, 2023/07/03
- [nongnu] scratch/evil 1ba1eb9b66 2/8: Better follow conventions for use of ' in docstrings, Stefan Monnier, 2023/07/03
- [nongnu] scratch/evil ea1b21d658 8/8: Misc minor changes,
Stefan Monnier <=
- [nongnu] scratch/evil df957ddb68 3/8: Prefer #' to quote function names, Stefan Monnier, 2023/07/03
- [nongnu] scratch/evil f09062ee12 6/8: Remove redundant `:group` args, Stefan Monnier, 2023/07/03