Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ex command no longer completes command contain dash (-) #1838

Open
kiennq opened this issue Oct 25, 2023 · 4 comments
Open

Ex command no longer completes command contain dash (-) #1838

kiennq opened this issue Oct 25, 2023 · 4 comments

Comments

@kiennq
Copy link

kiennq commented Oct 25, 2023

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 f84d345

@kiennq
Copy link
Author

kiennq commented Oct 25, 2023

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

@axelf4
Copy link
Collaborator

axelf4 commented Oct 25, 2023

it seems that your commit at f84d345 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.

@kiennq
Copy link
Author

kiennq commented Oct 25, 2023

: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.

@axelf4
Copy link
Collaborator

axelf4 commented Oct 25, 2023

: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 f84d345 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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants