0

In my Emacs (spacemacs) setup, with org-mode, I like to use both company-mode and org-cdlatex-mode.

I like company-mode to provide autocompletion most of the time, but I'd like to have cdlatex's auto-completion triggered by TAB first, only if cdlatex's autocompletion finds no completion, then the company's autocompletion should be used.

What would be the best solution?

  • I figure that I could somehow arrange the priority in processing the key event of TAB, letting cdlatex have the priority. (But how?)
  • Or, write my own TAB event dispatcher: first call org-try-cdlatex-tab, only if it return false, then call company-mode's function for TAB event processing. (This would be very customized, will be complicated to maintain.)
  • Or, use a different key for cdlatex autocompletion (This is quite doable, but requires additional human memory.)
Drew
  • 29,895
  • 7
  • 74
  • 104
Yu Shen
  • 2,770
  • 3
  • 33
  • 48
  • I just tracked the code of org.el, it turned out that "TAB" event triggering the call to org-try-cdlatex-tab is dispatched by org-cycle, therefore, it's a conflict between org-mode and global-company-mode. – Yu Shen Aug 18 '17 at 14:50
  • 1
    This may be a duplicate of https://stackoverflow.com/q/24687923 (which discusses the priority of minor mode keymaps) ? – phils Aug 19 '17 at 13:42
  • Yes, it's duplicated. – Yu Shen Aug 22 '17 at 05:36

0 Answers0