aboutsummaryrefslogtreecommitdiff
path: root/evil-ex.el
AgeCommit message (Collapse)Author
2025-01-20Remove evil--ex-expressionAxel Forsman
As after-change-functions such as evil--ex-update are not guaranteed to run, this commit ensures evil-ex re-parses the final Ex command string instead of relying on evil--ex-expression. This makes the workaround in commit 6afd86bbc740f3008e91881f990bf346b31d3f0b (Fix for evil-ex-teardown, 2025-01-03) to not overwrite a shortcut in evil--ex-expression no longer necessary. Closes #1949
2025-01-05Fix for evil-ex-teardownTom Dalziel
Fixes #1949
2024-12-29Remove permanent-local-hook from evil-ex-teardownAxel Forsman
This commit fixes the following error: Error in minibuffer-exit-hook (evil-ex-teardown): (wrong-type-argument stringp nil)
2024-12-14Call evil--ex-update one last time in minibuffer teardownTom Dalziel
Fixes #1941
2024-09-15Miscellaneous minor changesStefan Monnier
* evil-common.el (evil-with-delay): Add comment for last change. * evil-macros.el (font-lock-add-keywords): Use the font-lock faces rather than their obsolete variables. * evil-ex.el (evil-ex-define-argument-type): Make sure the function arguments can be compiled. (evil-ex-init-shell-argument-completion): Don't let-bind `completion-at-point-functions` because hooks aren't just variables.
2024-07-17Bind all possible ex cmd abbreviationsTom Dalziel
Means that :de expands to delete
2024-04-16treewide: replace `(eq/equal foo nil)` with `(null foo)`Konstantin Kharlamov
2023-08-27Add evil-command-line-mapAxel Forsman
There was a lot of duplication between evil-ex-completion-map and evil-ex-search-keymap, which meant that any rebinds had to be done twice. This commit fixes that by introducing evil-command-line-map as a common ancestor of the two keymaps. Also renames evil-ex-map to evil-ex-shortcut-map to avoid confusion, as its purpose is more niche than evil-ex-completion-map which functions the same as any other keymap passed to read-from-minibuffer.
2023-08-20Some cleanupsAxel Forsman
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-12Some cleanupsAxel 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-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-02Global print using messageTom Dalziel
2023-02-14Optimize Ex command completionAxel Forsman
With lexical binding it is possible to close over the list of Ex commands, instead of recomputing it on every keystroke while completing. Also, there is no need to call evil-ex-command-force-p on the command string, which uses try-completion, since the command functions are known as the evil-ex-commands alist values.
2023-02-14Compile Ex parserAxel Forsman
This commit reworks the function evil-parser into a macro that in turn expands to a parser. Some features that were not utilized have been dropped: * The GREEDY flag allowed backtracking to kick in instead of reporting an incomplete match. However the rules in cases where they are not deterministic are already listed in order of longest first. Lookaheads can still be used for this purpose. * Parsing is now always whitespace insensitive, but this is reversible without any hassle. * String replacement semantic actions. * (+ ...) rules no longer implicitly use seq. * Computation of the syntax tree has been deferred until when completion is requested.
2023-02-14Make Ex hooks not be permanentAxel Forsman
2023-02-07Defer loading of shell.elAxel Forsman
2023-01-12Fix executing macro infinite timesAxel Forsman
This commit fixes a regression caused by #1549 where you could no longer give a prefix argument to execute the macro in an infinite loop.
2022-10-13Fix compiler warningsTom Dalziel
2022-09-29doc: follow the Emacs Lisp Style Guidedalu
2022-09-28Fix Ex completion of empty stringAxel Forsman
An empty string will not parse as an Ex command, meaning evil-ex-cmd would be nil even after evil-ex-update returns. This commit makes sure evil-ex-command-completion-at-point handles this. Also remove the unnecessary nil-check in evil-ex-binding.
2022-08-25Store :/ search pattern and parse vim-style regexpTom Dalziel
Fixes #1520
2022-06-21Only look at mark when restoring point in visual stateTom Dalziel
2022-06-21Prompt user to reverse reversed ex rangeTom Dalziel
Fixes #1628
2022-05-03`evil-ex': `eval-expression' auto-completion (#1398)nbfalcon
Add auto-completion for `evil-ex' LISP expressions leveraging `elisp-completion-at-point' if available.
2022-04-25Bump version to 1.15.0Tom Dalziel
2022-04-14Ensure we're not in visual state if there's no ex rangeTom Dalziel
fixes #1595
2022-04-13Ex yank doesn't move pointTom Dalziel
In visual state, it restores point to beginning of visual range Fixes #1593
2022-02-01Add sentence marks to evil-ex-grammar (#1575)Brian Leung
2022-01-07Add `evil-want-empty-ex-last-command` to varsTom Dalziel
fixes #883
2022-01-03Support { and } marks in evil-ex-grammar (#1558)Brian Leung
2021-12-23Handle more registers and range types in ex grammar (#1556)Brian Leung
* evil-ex.el (evil-ex-grammar): Handle ] and [ registers Co-authored-by: Brian Leung <leungbk@posteo.net> Co-authored-by: Tom Dalziel <tom_dl@hotmail.com> * evil-ex (evil-ex-grammar): Handle more range types * evil-ex.el (evil-ex-grammar): Handle comma- or semicolon-separated ranges that omit the first argument. The current line will be used as the input. Co-authored-by: Brian Leung <leungbk@posteo.net> Co-authored-by: Nathaniel Nicandro <nathanielnicandro@gmail.com> Co-authored-by: Tom Dalziel <tom_dl@hotmail.com>
2021-12-11Don't abort ex if choosing completion with mouse (#1553)Tom Dalziel
Fixes #1551
2021-10-04Fix compiler warnings (#1525)Tom Dalziel
2021-07-24Add `*` ex-range for last visual range (#1500)Tom Dalziel
2021-06-28Fix 1482 addr wraparound (#1483)Tom Dalziel
* Add wraparound to `evil-ex-re-fwd` + `evil-ex-re-bwd` Fixes a bug noted in #1482 * Tests for 1482
2021-04-09Fix `C-r` at evil ex search prompt (#1453)Tom Dalziel
* Introduce `evil-paste-clear-minibuffer-first` to aid `C-r` on search * Add test for pasting from register in ex-search prompt
2021-01-09Add version to `define-obsolete-function-alias' invocationBrian Leung
The latest Emacs 28 requires this.
2020-03-04Bump version to 1.14.01.14.0Eivind Fonn
2020-02-22Deprecate evil-add-to-alist, which doesn't work with lexicalEivind Fonn
2020-02-03Clean up compilation warnings from lexical bindingEivind Fonn
2020-01-29Re-enable lexical bindingEivind Fonn
This reverts commit e9391ae769bee189ef6144b8861b117d5c948a80, and removes spurious debug messages.
2020-01-28Revert "Enable lexical binding"Eivind Fonn
This reverts commit c6086a7b0b44963071096e3ed7545f617de88915.
2020-01-28Fix indentationEivind Fonn
2020-01-28Implement Vim Ctrl-f in minibuffer.Nathan Gass
Open apropriate command windows for Ctrl-f while in minibuffer for an ex command or a search. As all ways to abort a minibuffer do not return and restore the active buffer, we have to set the content of the minibuffer and exit normally to trigger the apropriate action. Also restoring the window configuration is necessary so minibuffer-selected-window is not changed.