| Age | Commit message (Collapse) | Author |
|
This either requires a dependency on the `nadvice` package,
or bumping the minimum Emacs version to 24.4. I went with
the `nadvice` package, but maybe bumping up to 24.4 would be better.
* evil.el: Require `nadvice`.
* evil-core.el (evil--advices): New var.
(evil-mode): Use it instead of `ad-dis/enable`.
(evil--advice-add): New function.
(set-window-buffer, select-window, toggle-input-method, use-global-map):
* evil-search.el (isearch-message-prefix, isearch-delete-char)
(isearch-lazy-highlight-search):
* evil-integration.el (keyboard-quit, wdired-change-to-dired-mode)
(show-paren-function, quail-show-key, describe-char, ace-jump-done):
Use `(evil--)advice-add` instead of `defadvice`.
(preceding-sexp, pp-last-sexp): Remove old code for when `advice-add`
is not available.
* evil-repeat.el (evil--read-key-sequence-advice): Adapt to use in
`advice-add`.
(read-key-sequence, read-key-sequence-vector): Use `advice-add`.
* evil-keybindings.el (elp-results): Use `advice-add` and move outside
of `eval-after-load`.
|
|
Fixes #502, fixes #1835. Refreshing the cursor when changing the evil state is
only needed (or almost only, see below) when the current buffer is displayed in the
selected window. If this is not the case, and the buffer is only displayed or
its window selected at some later point in time, then `evil-refresh-cursor` will
be called as part of the `window-configuration-change-hook` or as advice to
`select-window`.
However, this introduces the following tiny (and maybe acceptable?) regression:
When doing something like
```elisp
(with-current-buffer (some-buffer-displayed-in-another-window)
(some-evil-state-with-a-different-cursor-type))
```
the cursor will not be refreshed in the other window before selecting it. The
cursor colour should indeed not be refreshed, because it is defined for the
whole frame; however, the cursor type should in principle be changed, as it is
defined per buffer and also defines the shape of the cursor in non-selected
windows.
There exist different ways to also handle this case, but they mostly seem ugly
or needlessly complicated to me. I think the most elegant way to fix this would
involve implementing per-buffer cursor colors in Emacs (as suggested in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24153d). What do you think?
|
|
* Added clarification to evil-define-key for escaping modifier keys
It is useful to have clarification in the doc string for
evil-define-key that it is necessary to escape modifiers keys for
users that are accustomed to using functions like global-set-key or
keymap-global-set where this is not necessary. This is also not made
particularly clear in the define-key function itself, which is a
legacy function.
* Fixed poor wording and used kdb in place of escape sequence
|
|
This commit reintroduces the evil-mode advice that commit
f003ca28a9691d24a17866e5dce3e7866c9bb257 replaced with a BODY argument
to define-globalized-minor-mode, as that broke support for older
versions of Emacs since the BODY parameter was only recently
introduced in Emacs 27.
|
|
|
|
* README.md: Mention that `undo-fu` is also in NonGNU ELPA and update
its repository URL.
* evil.el: Update the undo-fu repository URL.
* evil-macros.el (evil-define-interactive-code): 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 FIXME.
* evil-commands.el (evil-save-side-windows): Silence spurious warning.
|
|
This commit makes evil-with-delay generated code work using a single
lambda that returns the result of condition, running body if non-nil.
This way the byte compiler sees that body is guarded by condition,
which fixes the FIXME.
|
|
Save some kittens by using a macro instead of using `eval`.
This also exposes more code to the compiler, so should result in
more efficient code and potentially better compiler warnings.
* evil-common.el (evil-unquote): Delete unused function.
(evil--with-delay): New function, extracted from `evil-delay`.
(evil-with-delay): New macro, extracted from `evil-delay`.
(evil-delay): Redefine using `evil-with-delay` and declare obsolete.
* evil-states.el (evil-visual-activate-hook):
* evil-core.el (evil-define-key):
* evil-commands.el (evil-execute-in-normal-state): Use `evil-with-delay`.
|
|
Some of these commits can be almost immediately restored,
once the time is found to do so.
Revert "Fix evil-with-delay with dynamic binding"
This reverts commit 1e9b2434264529fe0dd964b68fe89236a4abeac3.
Revert "Some cleanups"
This reverts commit 0cbd61f2de104fab16602d0418605cd0513b16f3.
Revert "Misc minor changes"
This reverts commit b291039b0c6ffc3b2f3c9f02b8ad2f0041127b12.
Revert "Merge evil-with-delay condition and body lambdas"
This reverts commit 1b56ffcc102b4c5f8b015e760b5f9cf5932622af.
Revert "(evil-with-delay): New macro, extracted from `evil-delay`"
This reverts commit 3d7faadf30016a8c20699a5fb1b5731b8a49dcd2.
Revert "Make evil-search-wrap-ring-bell work with evil-search"
This reverts commit 5e72cf5b6d57b785ea229236bb5c4638db2c9a05.
Revert "Stop the '</'> and '[/'] marks from intertwining"
This reverts commit 26db9441a13ebedb2481d7ada4c3b5e60ec22795.
Revert "Remove redundant `:group` args"
This reverts commit 6e30037fdc6a275d78d6b82d89bd8e47bcf4d4e3.
Revert "Avoid eval in evil-test-buffer"
This reverts commit 27d81ad406d2d3e07591b927357d2354ef5b5c65.
Revert "Use lexical-binding everywhere"
This reverts commit 44c7f301468c264a781be4ee8ae879fe1b457e60.
|
|
|
|
* README.md: Mention that `undo-fu` is also in NonGNU ELPA and update
its repository URL.
* evil.el: Update the undo-fu repository URL.
* evil-macros.el (evil-define-interactive-code): 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 FIXME.
* evil-commands.el (evil-save-side-windows): Silence spurious warning.
|
|
This commit makes evil-with-delay generated code work using a single
lambda that returns the result of condition, running body if non-nil.
This way the byte compiler sees that body is guarded by condition,
which fixes the FIXME.
|
|
Save some kittens by using a macro instead of using `eval`.
This also exposes more code to the compiler, so should result in
more efficient code and potentially better compiler warnings.
* evil-common.el (evil-unquote): Delete unused function.
(evil--with-delay): New function, extracted from `evil-delay`.
(evil-with-delay): New macro, extracted from `evil-delay`.
(evil-delay): Redefine using `evil-with-delay` and declare obsolete.
* evil-states.el (evil-visual-activate-hook):
* evil-core.el (evil-define-key):
* evil-commands.el (evil-execute-in-normal-state): Use `evil-with-delay`.
|
|
Also try and make the docstring fit within 80 columns.
This fixes some incorrect uses and eliminates some warnings.
|
|
When lexing a string with string-match and its START argument, there
is no way to anchor matches to the START position. Instead, one must
either allocate substrings - as done prior to commit
56b43b6f7e014e905f85df1c542c67f46ea99566 - or use looking-at etc.,
instead. This commit opts for the latter.
The Ex completion-at-point functions are also rewritten in order to
avoid having to add ex-index text properties to the command string,
since evil--ex-syntactic-context could be extended to provide that
information just as easily.
|
|
|
|
Also replace a few calls to evil-filter-list that destructively
modified user-provided lists with cl-remove-if.
|
|
* Deprecate evil-loop since it is too niche, and manages makes
evil-motion-loop less readable.
* Use separate setq-local calls for each variable/value pair, since
the combined form does not exist in Emacs versions <=25.3.
|
|
This ensures that the input method after deactivating evil-local-mode is
the same as the input method used for states with a non-nil
:input-method property.
This issue was discovered while investigating why the input method
couldn't be set by the agda2-mode while evil was active [1]. As the
change in major mode (to agda2-mode) caused evil-local-mode to be
disabled and reenabled by `define-globalized-minor-mode evil-mode`, the
input method was lost because the default state (i.e. normal state) does
have an :input-method property of nil.
In summary this patch fixes the approach used by agda2-mode [2] and the
official recommendation in the Emacs manual [3], e.g.
(add-hook 'text-mode-hook
(lambda () (set-input-method "german-prefix")))
[1]: https://github.com/agda/agda/issues/2141
[2]: https://github.com/agda/agda/blob/37554c46cbd770fa630f9b164e2b543506acbdbc/src/data/emacs-mode/agda2-mode.el#L432
[3]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Select-Input-Method.html
|
|
All current uses of evil-sort only pass two arguments, for which a
conditional swap suffices.
Also replace the implementation of evil-swap with cl-rotatef, since that
is built-in and produces marginally better code for three or more
variables.
|
|
This fixes the issue of the evil-send-(local-)leader commands being
recognized as the motion while in Operator-pending state. Additionally,
describe-key (C-h k) can now be used to lookup keybindings using leader.
Note that simply binding [(local-)leader] keyboard macros would not
work, since then the command would not receive the prefix argument.
Closes #1711
|
|
The predicate (listp state) is true also for the value nil of state,
meaning the correct clause with all-states was never considered.
Closes #1383
|
|
This commit fixes some issues surrounding the initialization of Evil.
First of all, since GNU Emacs 26.1 major mode hooks actually do run in
Fundamental mode buffers. In any case, manually enabling
fundamental-mode correctly instead of turn-on-evil-mode (by setting
major-mode default) successfully enables evil-local-mode, as major mode
hooks then run. The major-mode variable also never needed to be reset;
it is the job of the major mode to set it, as it starts off as
fundamental-mode regardless of its default value.
Secondly, while some hooks and variables set up by evil-local-mode were
marked as permanent, this did not matter as evil-initialize
unconditionally reinitialized evil-local-mode whenever the major mode
changed. Fixed by marking them all as permanent and not executing
evil-local-mode if it is already enabled.
Closes #1268, closes #1561
|
|
|
|
|
|
|
|
|
|
|
|
* evil-core: refactored `evil-get-auxiliary-keymap`
In `evil-get-auxilliary-keymap`, there's already a check on `state` when entering the function.
Should `state` be `nil`, it won't enter the `let*` form.
Hence the binding specification
`(aux (if state (lookup-key map key) map))`
always reduces to
`(aux (lookup-key map key))`
This commit removed unnecessary `if` form.
* minor changes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This reverts commit e9391ae769bee189ef6144b8861b117d5c948a80, and
removes spurious debug messages.
|
|
This reverts commit c6086a7b0b44963071096e3ed7545f617de88915.
|
|
|
|
|
|
|
|
|
|
Fix #1180
|
|
|
|
|
|
Version 1.2.15 was accidentally tagged as 1.12.15, and released as
such by MELPA Stable, so now I guess we have to run with it.
|
|
|
|
|
|
Add evil-send-leader and evil-send-localleader which will push the symbol
<leader> or <localleader> into the unread-command-events list. This allows one
to bind a key to evil-send-leader to make it a leader key and activate bindings
like the following.
(defun hi ()
(interactive)
(message "hi"))
(define-key evil-normal-state-map (kbd "<leader> h") 'hi)
For convenience, evil-set-leader can be used as follows
(evil-set-leader 'normal (kbd "C-c"))
An optional argument makes it a localleader.
|
|
|
|
|