evil icon indicating copy to clipboard operation
evil copied to clipboard

Ex command no longer completes command contain dash (-)

Open kiennq opened this issue 1 year ago • 4 comments

Issue type

  • Bug report

Environment

Emacs version: GNU Emacs 30.0.50 Operating System: Windows 11 Evil version: 1.15.0 Evil installation type: MELPA Graphical/Terminal: Graphical Tested in a make emacs session (see CONTRIBUTING.md): Yes

Reproduction steps

  • Start Emacs
  • Enable evil, type :make- and press tab.

Expected behavior

All commands start with make- should be shown

Actual behavior

No matches

Further notes

Thiis is a regression of f84d3453b312bd8ec0a1c092d075bbc3d91e157b

kiennq avatar Oct 25 '23 14:10 kiennq

@axelf4, it seems that your commit at f84d3453b312bd8ec0a1c092d075bbc3d91e157b broke the evil's ex completion-at-point for commands that contain - character

kiennq avatar Oct 25 '23 14:10 kiennq

it seems that your commit at f84d3453b312bd8ec0a1c092d075bbc3d91e157b broke the evil's ex completion-at-point for commands that contain - character

Thanks for reporting the issue. However, it is not that simple, since arguably that commit fixed completion. The Ex command make- is parsed as a call to :make with - as the argument, because the prefix make is a valid Ex command (this logic is needed to parse e.g. substitute-foo- as a call to :substitute). This was always the case (please correct me if I am wrong). Thus - gets completed as a shell command, instead of make- getting completed as a command.

If you instead try to complete show-, where show is not a valid Ex command, then you will see that it does get completed as a command.

axelf4 avatar Oct 25 '23 15:10 axelf4

:make-frame will invoke the Emacs command M-x make-frame though (there's even a test case for that). Well, admittedly I abused the evil Ex command ability of being able to invoke Emacs commands.

kiennq avatar Oct 25 '23 16:10 kiennq

:make-frame will invoke the Emacs command M-x make-frame though (there's even a test case for that).

Yes, if there is an exact Emacs command match then that is preferred, even with a valid Ex command prefix (see this bit). To be clear, I consider the current situation less than ideal; you need to be allowed to write :substitute/.../ without a space between substitute and /.../, but :make/.../ does not make sense. That is what should be changed, commit f84d3453b312bd8ec0a1c092d075bbc3d91e157b only improved completion such that the parsing detail became explicit.

Well, admittedly I abused the evil Ex command ability of being able to invoke Emacs commands.

I do that as well and would not consider it abuse. :)

axelf4 avatar Oct 25 '23 16:10 axelf4