According to describe-key
(C-h k
), every character I type runs self-insert-command
and I suspect that self-insert-command
calls some undocumented hook to perform text completition.
I am trying to debug company-mode
, which occasionally fails to complete my input. So, describe-function
says that self-insert-command
calls post-self-insert-hook
. I set it to nil
and tried to type something that would be autocompleted — and it was completed anyway! In addition to this, self-insert-command
calls expand-abbrev
and auto-fill-function
, but I tried to call both, and neither shows a popup text. So, it seems like every keypress runs some other hook used by company-mode
.
I found that company-complete-common
is the function that does autocompletition, so I set a breakpoint there to find this mysterious hook by using a backtrace. And… it didn't work! It works if I call company-complete-common
interactively, but if I trigger completion by typing a character, and the same window pops up, the breakpoint is ignored!
I'm out of ideas, I hope somebody knows how this works.
company.el
thatcompany-mode
sets somecompany-pre-command
andcompany-post-command
to apre-command-hook
/post-command-hook
, but these doesn't do autocompletition either.