I don't seem to be getting the completion behavior in Org Mode that the manual says I should get (or see (info "(org)Completion")
). It says that M-<TAB>
will offer various Org specific completions in certain locations, for example:
• At the beginning of a headline, complete TODO
keywords.
• After \
, complete TeX symbols supported by the exporter.
• After *
, complete headlines in the current buffer.
And a few other things like that. And the manual then says that "When point is anywhere else, complete dictionary words using Ispell."
OK, so here is what I actually get:
Prior to Org 9.2 (I tried with 9.1.9), both
M-<TAB>
andC-M-i
callpcomplete
which does everything the manual says except the last thing about using Ispell!On Org 9.2,
M-<TAB>
callspcomplete
which does everything the manual says except the last thing about Ispell; andC-M-i
callsispell-complete-word
that, obviously, just does the Ispell thing.
Weirdly, I cannot figure out where C-M-i
is being bound to ispell-complete-word
(according to C-h k
the binding is in org-mode-map
, but the Org Mode source files don't seem to mention ispell-complete-word
at all).
I've tested both Org 9.1.9 and Org 9.2 starting from emacs -Q
, so this shouldn't be a problem with my configuration.
Is the manual just wrong about the behavior of completion? In which case I should file a bug, I guess.
The behavior described in the manual sounds pretty sweet! How do I get it? That is, a single keybinding to do the Org specific completions and if none are possible, then use Ispell.
Just out of curiosity: how the hell is Org Mode 9.2 binding
C-M-i
toispell-complete-word
and how could I have discovered where it happens?
C-M-i
is a globalispell
binding (but I could not find where this is done either), which used to be overridden by the local map in Org mode. Curiously, in the Org mode source for v 9.2, you will find the binding forM-<TAB>
andESC <TAB>
, but not forC-M-i
. For the time being, I bound it manually topcomplete
in org-mode-map and it seems to work (except for callingispell
"anywhere else").C-M-i
is bound toispell-complete-word
in thetext-mode-map
here.outline-mode
is derived fromtext-mode
andorg-mode
fromoutline-mode
. As for 1, I think it's a bug, as you say. 2 would indeed be cool.C-h k C-M-i
in an Org Mode buffer, the help that pops out says the binding is found inorg-mode-map
, which you've taught me to not to take too literally. :)org-mode-map
. :/ (If you inspect the variableorg-mode-map
you'll find it there...) Unfortunately, as you note, the help forC-M-i
doesn't tell you that it was "inherited" fromtext-mode
(I'm not sure if Emacs explicitly tracks this info); neither does the help fororg-mode-map
tell you that some of its binding were inherited from elsewhere. Only once you get to the help buffer fororg-mode
itself (linked to fromorg-mode-map
) do you find out thatoutline-mode
isorg-mode
's parent mode (and ditto foroutline-mode
->text-mode
).