aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-08-23Fix Vim URL in docs (#1825)W. Leighton Dawson
* Fix vim.org URL in evil.texi * Fix vim.org URL in overview.rst
2023-08-20Fix evil-with-delay with dynamic bindingAxel Forsman
If dynamic binding is used when expanding the macro, then the function will not capture fun-name as a closure. Fix this by using apply-partially which is defined in a source file that uses lexical binding.
2023-08-20Some cleanupsAxel Forsman
2023-08-20Misc minor changesStefan Monnier
* 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.
2023-08-20Merge evil-with-delay condition and body lambdasAxel Forsman
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.
2023-08-20(evil-with-delay): New macro, extracted from `evil-delay`Stefan Monnier
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`.
2023-08-20Make evil-search-wrap-ring-bell work with evil-searchJustin Koh
evil-search-wrap-ring-bell only worked when evil-search-module was isearch. Make it work with evil-search as well.
2023-08-20Stop the '</'> and '[/'] marks from intertwiningAxel Forsman
The function evil-visual-paste would assign to evil-visual-point/-mark the same markers used by the '[ and '] marks. Therefore, after a single visual paste Normal mode "gv" would act funkily in that buffer ever after. To reproduce: * Enter a new buffer with the contents: x y * With the cursor on "x", type "ylvpjxgv". The expectation is that "x" should be re-selected. Instead the empty lower line is selected due to it being the previously changed text. This commit fixes this, and also removes unused definitions related to evil-visual-previous-point/-mark.
2023-08-20Remove redundant `:group` argsStefan Monnier
In the absence of `:group`, `defcustom` and `defface` default to the group that was last defined in the same file. * evil-jumps.el: Remove redundant `:group` args.
2023-08-20Avoid eval in evil-test-bufferAxel Forsman
Whatever is returned by the macro will be evaluated anyway. This fixes errors due to lexical-binding now being enabled in evil-tests.
2023-08-20Use lexical-binding everywhereStefan Monnier
Most of the code already used lexical-binding, but there were still a few of remnant of use of the old dynbound dialect. * evil-tests.el: Activate `lexical-binding`. (evil-test-change-state): Initialize the local vars immediately rather than as a separate step. Remove unused vars `keymap` and `local-keymap`. (evil-test-auxiliary-maps): Rename local var to `evil--map` and declare it dynbound since we need `evil-define-key` to have access to it. (evil-test-exclusive-type): Remove unused var `third`. (evil-test-text-object): Mark unused var `type`. (evil-with-both-search-modules): Move before first use. (evil-test-properties): Rename local var to `evil--alist` and declare it dynbound since we need `evil-put-property` to have access to it. * evil.el: Activate `lexical-binding`. * evil-types.el ("<addr>"): * evil-common.el (evil--eval-expr): * evil-commands.el (evil-ex-global): Tell `eval` to use the lexbind dialect of ELisp.
2023-08-14Advise `lisp-eval-last-sexp` like elisp equivalentTom Dalziel
Fixes issue raised in #1541
2023-08-13Urgent revert of recent commits while evil is brokenTom Dalziel
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.
2023-08-13Fix evil-with-delay with dynamic bindingAxel Forsman
If dynamic binding is used when expanding the macro, then the function will not capture fun-name as a closure. Fix this by using apply-partially which is defined in a source file that uses lexical binding.
2023-08-12Some cleanupsAxel Forsman
2023-08-12Misc minor changesStefan Monnier
* 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.
2023-08-12Merge evil-with-delay condition and body lambdasAxel Forsman
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.
2023-08-12(evil-with-delay): New macro, extracted from `evil-delay`Stefan Monnier
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`.
2023-08-10Make evil-search-wrap-ring-bell work with evil-searchJustin Koh
evil-search-wrap-ring-bell only worked when evil-search-module was isearch. Make it work with evil-search as well.
2023-08-09Stop the '</'> and '[/'] marks from intertwiningAxel Forsman
The function evil-visual-paste would assign to evil-visual-point/-mark the same markers used by the '[ and '] marks. Therefore, after a single visual paste Normal mode "gv" would act funkily in that buffer ever after. To reproduce: * Enter a new buffer with the contents: x y * With the cursor on "x", type "ylvpjxgv". The expectation is that "x" should be re-selected. Instead the empty lower line is selected due to it being the previously changed text. This commit fixes this, and also removes unused definitions related to evil-visual-previous-point/-mark.
2023-08-07Remove redundant `:group` argsStefan Monnier
In the absence of `:group`, `defcustom` and `defface` default to the group that was last defined in the same file. * evil-jumps.el: Remove redundant `:group` args.
2023-08-07Avoid eval in evil-test-bufferAxel Forsman
Whatever is returned by the macro will be evaluated anyway. This fixes errors due to lexical-binding now being enabled in evil-tests.
2023-08-07Use lexical-binding everywhereStefan Monnier
Most of the code already used lexical-binding, but there were still a few of remnant of use of the old dynbound dialect. * evil-tests.el: Activate `lexical-binding`. (evil-test-change-state): Initialize the local vars immediately rather than as a separate step. Remove unused vars `keymap` and `local-keymap`. (evil-test-auxiliary-maps): Rename local var to `evil--map` and declare it dynbound since we need `evil-define-key` to have access to it. (evil-test-exclusive-type): Remove unused var `third`. (evil-test-text-object): Mark unused var `type`. (evil-with-both-search-modules): Move before first use. (evil-test-properties): Rename local var to `evil--alist` and declare it dynbound since we need `evil-put-property` to have access to it. * evil.el: Activate `lexical-binding`. * evil-types.el ("<addr>"): * evil-common.el (evil--eval-expr): * evil-commands.el (evil-ex-global): Tell `eval` to use the lexbind dialect of ELisp.
2023-08-07Select inner tag even when emptyTom Dalziel
Fixes part of #1815
2023-08-07Prefer #' to quote function namesStefan Monnier
2023-08-07Better follow conventions for ' in docstringsStefan Monnier
Also try and make the docstring fit within 80 columns. This fixes some incorrect uses and eliminates some warnings.
2023-08-06Make Ex registers available in all minibuffersAxel Forsman
2023-08-06Support recursive editing in ExAxel Forsman
This is a proper fix for #569 instead of commit ab0f6a546e6c703cd8d3c0d7c1035196b0455c45, which simply aborted the Ex command line upon it being unfocused. Apart from disallowing recursive editing, that also made debugging Ex errors impossible. The core issue was that evil-ex-current-buffer had a dual purpose: (I) While in the minibuffer, it stored the original buffer the Ex command would eventually act on, and was used for special registers and some argument handlers; and (II) While executing an Ex command it was non-nil, which signified that commands should use the variables evil-ex-range, evil-ex-bang and evil-ex-argument set by evil-ex-call-command, instead of, say, prompting for a motion. However, during recursive editing due to (I) evil-ex-current-buffer was dynamically let-bound, triggering the special behavior in (II), meaning all operators always worked on the evil-line motion, i.a. Fix this by, for (I), only setting evil-ex-current-buffer buffer-locally in the Ex minibuffer, renaming it to evil-ex-original-buffer (similar to minibuffer--original-buffer), and for (II) instead introducing evil-called-from-ex-p which is set to t solely during evil-ex-call-command. Closes #1415, by only making use of the return value of minibuffer-selected-window where required.
2023-07-18Delay evil-ex-search-update-pattern until idleAxel Forsman
2023-07-18Simplify evil-ex-parseAxel Forsman
2023-07-17Read Ex commands from bufferAxel Forsman
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.
2023-07-14Format Normal mode "!" prompt as ".,.+N!"Axel Forsman
2023-07-12Non-visual ex-print (fix)Tom Dalziel
2023-07-12Use var instead of mark in evil-yank-line-handlerAxel Forsman
Closes #1803
2023-07-12Avoid marker for match-end in :substituteAxel Forsman
2023-07-12Enter Insert mode on "o"/"O" even with indent failAxel Forsman
Commit bf98a96b769b578aaf80826c4233bcd0211ffc0b did this by reordering such that indenting happened after having already changed to Insert state, which had to be reverted in commit 3641c6e619fd3caef15c9e9a9e4420a57e079f2c for i_CTRL-A correctness. Use unwind-protect to satisfy both requirements.
2023-07-12Remove vendored goto-chg packageAxel Forsman
2023-07-09Autoload evil-digraphAxel Forsman
2023-07-05Substitute key bindings correctly in manualAxel Forsman
The Sphinx Emacs Lisp extension assumed all \[command] key sequence substitutions in documentation strings are preceded by a \<mapvar> sequence specifying the keymap, unlike substitute-command-keys which is used when accessing docstrings within Emacs. With this commit the actual substitute-command-keys function is used when building docstringdb.json, instead of the Python reimplementation. The drawback is that docstringdb.json now contains partial Sphinx markup.
2023-07-05Generate docstringdb.json at build timeAxel Forsman
Closes #1544. Note that the generated Texinfo file cannot be removed as it is built by Sphinx which is not available during ELPA package builds.
2023-07-02Remove evil-repeat-start-hookAxel Forsman
It was a no-op since (evil-repeat-type this-command t) does not returns t, and otherwise the call to evil-repeat-start would overwrite changes done by (funcall repeat-type 'pre) in evil-repeat-pre-hook.
2023-07-02Store command properties as symbol propertyAxel Forsman
Also replace a few calls to evil-filter-list that destructively modified user-provided lists with cl-remove-if.
2023-06-25Small cleanupsAxel Forsman
* 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.
2023-06-22Fix CTRL-O at BOLAxel Forsman
The cursor should not be put after EOL if it has moved to a different line. This commit also changes evil--execute-normal-eol-pos to be a marker, since the Normal state command may insert/remove text. Closes #1804
2023-06-21Simplify evil-ex-show-digraphsAxel Forsman
2023-06-21Remove undo-tree integration boundp checksAxel Forsman
2023-06-08Improve case handling for :matchTom Dalziel
2023-06-06Add ex-matchTom Dalziel
2023-06-04evil-ex-z (#1798)Tom Dalziel
2023-06-02Print using minibufferTom Dalziel