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

How to rebind "C-g" with "M-g" #1828

Open
hc36123 opened this issue Aug 23, 2023 · 2 comments
Open

How to rebind "C-g" with "M-g" #1828

hc36123 opened this issue Aug 23, 2023 · 2 comments

Comments

@hc36123
Copy link

hc36123 commented Aug 23, 2023

Issue type

  • Question
  • Help wanted

Environment

Emacs version: <28.2>
Operating System: <Windows 10+Cygwin>
Evil version: <1.15.0>
Evil installation type: ELPA
Graphical/Terminal: Graphical
Tested in a make emacs session: No

Reproduction steps

  • Start Emacs
  • M-x eval-expression, type (define-key key-translation-map (kbd "M-g") (kbd "C-g"))
  • M-x xxxxxx, type M-g or C-g, return Quit successfully
  • :w xxxxxx, type M-g or C-g, return Quit successfully
  • C-x, type C-g return Quit, however, it doesn't work with M-g

Expected behavior

C-x, then M-g should result a successful Quit

Actual behavior

Further notes

@tomdl89
Copy link
Member

tomdl89 commented Aug 23, 2023

@hc36123 what does this have to do with evil? I can't see any calls to evil fns in your repro steps. Are you just saying this behaviour occurs with evil-mode enabled, but not when it isn't?

@hc36123
Copy link
Author

hc36123 commented Aug 23, 2023

In evil mode, C-g after C-x helps to quit the C-x, which is fantastic if I want to cancel a mistyped C-x. This feature doesn't work in the normal emacs state (when evil-mode is disabled), and I guess it may be a feature provided by Evil. After rebinding M-g to C-g, I found M-g can not cancel the prefix argument C-x. This is not an Evil bug. I just need help to figure out why this rebinding does not work.

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