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

Error with C-w T on Emacs < 28 #1811

Open
Tekki opened this issue Jul 17, 2023 · 5 comments
Open

Error with C-w T on Emacs < 28 #1811

Tekki opened this issue Jul 17, 2023 · 5 comments

Comments

@Tekki
Copy link

Tekki commented Jul 17, 2023

Issue type

  • Bug report

Environment

Emacs version: 27.1
Operating System: Debian Bullseye
Evil version: 1.15.0
Evil installation type: Melpa
Graphical/Terminal: Yes

Reproduction steps

  • Start Emacs
  • Open 2 buffers in 2 windows
  • Press C-w T

Expected behavior

Buffer should be moved to a new tab, or nothing should happen.

Actual behavior

Error message: "Wrong type argument: commandp, tab-window-detach"

Further notes

tab-window-detach only exists in Emacs >= 28. We should probably check for the existence of the function instead of the feature in evil-maps.el:

(when (featurep 'tab-bar)
  (define-key evil-window-map "T" 'tab-window-detach))
tomdl89 added a commit to tomdl89/evil that referenced this issue Jul 20, 2023
@tomdl89
Copy link
Member

tomdl89 commented Jul 20, 2023

@Tekki how about the fix in tomdl89@724a362 ?

tomdl89 added a commit to tomdl89/evil that referenced this issue Jul 20, 2023
@Tekki
Copy link
Author

Tekki commented Jul 21, 2023

@Tekki how about the fix in tomdl89@724a362 ?

Looks good. Tested on 27 and 28.

@axelf4
Copy link
Collaborator

axelf4 commented Jul 21, 2023

Is it not better to get an error that the command does not exist rather than that the keybinding does not exist?

@tomdl89
Copy link
Member

tomdl89 commented Jul 21, 2023

Possibly, but "Wrong type argument: commandp, tab-window-detach" isn't super clear to many users, and there are plenty of vim commands that we haven't implemented yet, which appear as undefined keybinding messages instead of "command does not exist" sort of messages.

@Tekki
Copy link
Author

Tekki commented Jul 22, 2023

Only a meaningful message would be a real solution. At the moment, if we don't bind C-w T, C-w t will be used instead and evil-window-top-left called. This is probably as confusing for the user as "Wrong type argument...".

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

3 participants