1

(Using latest version of Spacemacs, on Windows)

I'm new to org-mode and really need to figure out how to get completion working for stuff like tags and #+ options. Apparently org uses pcomplete as the completion backend. Indeed M-x pcomplete (helm) does offer a buffer with long list of completions for #+.

The manual says various completions are accessible with TAB and M-TAB. TAB works fine for blocks. But M-TAB is alt-tab in Windows and therefore cannot possibly be used. I think most Linux DE's also use alt-tab for window switching, while the dedicated Meta key has not been seen on keyboards for ages — which really makes me wonder why is this is still the default for such an important feature as completion.

I tried (global-set-key (kbd "<f1> 1") (kbd "M-<TAB>")) and (global-set-key (kbd "<f1> 1") (kbd "M-TAB")). Now <f1> 1 is mapped to "Keyboard macro", but it doesn't invoke pcomplete (or anything else in org).

So: How do you remap M-TAB?

(Note: I looked for an answer online and the stuff I tried is what I found. Doesn't seem to work)

(Note2: I've tried ESC TAB and C-M-i (since helm says that's what M-TAB is mapped to), but these keys just jump the cursor to the next line and nothing else.)

  • 1
    These are two separate questions. Please ask them in two separate posts (but do some searching on the keybinding question about M-TAB, as it's almost surely a duplicate). – Dan May 3 '17 at 21:15
  • Done. That meta key symbol next to your username is very apropos. – user27636 May 3 '17 at 21:42
  • In practice, Meta is just Alt these days -- the language is a holdover from Emacs's venerable origins. If I understand correctly, you want to find a way to call the command bound to M-TAB with a different keybinding, correct? The most straightforward thing to do is to find out what command that is (the manual should tell you), and then bind that command to a different key. – Dan May 3 '17 at 21:47
  • 1
    Yeah but M-TAB is hijacked by most operating systems for task switching. Should I be binding pcomplete then? Can't you just rebind the key itself, as I tried above? How do you personally use completion in org (if you do)? – user27636 May 3 '17 at 21:55
  • Just use ESC TAB instead of M-TAB on Windows. – Drew May 3 '17 at 22:40
1

See the Info page "(emacs) Windows Keyboard" for an explanation on the expression (w32-register-hot-key [M-tab])

On those systems where I used that hot-key for Emacs I use Windows-Tab or Windows- to switch to other apps.

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.