I would like to use Meta + Tab or Meta + ; keybindings in emacs to correct a spelling instead of using the ispells default one. Please note that I am open emacs in terminal.

I have tried following but it did not help. Is there any way to fix it?

  • (global-set-key (kbd "<M-tab>") 'helm-flyspell-correct)
  • (global-set-key (kbd "<M-;>") 'helm-flyspell-correct)
  • Try (kbd "M-;"). Generally, use the syntax that C-h k shows you for the key sequence. – Drew May 18 at 20:58
  • Does your OS steal <M-tab>, perhaps? What happens when you use it? – Drew May 18 at 20:58
  • IIRC, you are doing this in terminal emacs, right? Does M-<tab> even exist? I gave you a recipe in a comment to another question on how to check for that. – NickD May 18 at 21:51
  • Yes I am doing it inside the terminal. I think it does autocorrent suggestions for ispell, but shows the work on the mini-buffer. Instead I wanted to use helm-flyspell-correct. // When I use M-tab inside Safari or other windows it keeps moving to next element in the page. – alper May 18 at 21:58
  • @Drew I have also tried (kbd "M-;") , it just enters the character ; – alper May 18 at 22:00

It is (kbd "M-<tab>"). Note that M- is outside the <>

| improve this answer | |
  • I have following (global-set-key (kbd "M-<tab>") 'helm-flyspell-correct): but still it does not recognize helm-flyspell-correct, hence do the defualt ispell's suggestions – alper May 18 at 17:41
  • Its possible that a binding in another keymap is shadowing the one in your global keymap. The global keymap is the last place it is check. You can check what function is being called with C-h k. – PuercoPop May 19 at 16:26
  • I got following for alt-tab: C-M-i runs the command elpy-company-backend (found in elpy-mode-map), which is an interactive compiled Lisp function in ‘elpy.el’. It is bound to C-M-i, <menu-bar> <Elpy> <Complete>. (elpy-company-backend COMMAND &optional ARG &rest IGNORED) A company-mode backend for Elpy. – alper May 25 at 9:43
  • Ok, so that means that your global binding is shadowed by the binding in elpy-mode-map. If you want to make the binding available when editing a python file you would have to remove the binding from the elpy-mode-map. You can do so with (define-key elpy-mode-map (kbd "M-<tab>") nil) – PuercoPop May 26 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.