[Tex/LaTex] Aquamacs with AUCTeX, Flyspell and completion

aquamacsauctexemacs

When I'm editing a file in LaTeX-mode (I guess it means AUCTeX), and the flyspell is enabled, then M-TAB is not responding. I cannot get completion of standard LaTeX commands – for example it won't complete \newc to \newcommand.

I couldn't find information about this around… I'm using Aquamacs with 23.3.1 Emacs on Mac OS X.

Best Answer

What does M-TAB do - anything? Is there a key combination mentioned in your LaTeX menu after "Complete Macro"? The lisp function which should be called is "TeX-complete-macro". Try running it manually by typing

\newc

and leave the cursor after this and do

M-x TeX-complete-macro

If this works, then you can probably just rebind the key in your .emacs with

(add-hook 'TeX-mode-hook (lambda () (define-key TeX-mode-map "<M-tab>" 'TeX-complete-macro)))

Update: It seems there is a flyspell variable which controls this: flyspell-use-meta-tab. You can probably set this to nil and it will then work.