My auto-completion all of a sudden changed its behavior, and I have no clue why. When I auto-complete a mathematical expression, like \subseteq, say, it will introduce dollar signs in front and at the end. However, it only does this, if I am in math-mode. To illustrate:
\subse TAB
gives
\subseteq
and
$\subse TAB
gives
$$\subseteq$
which renders the auto completion completely useless, as everytime I have to delete the dollar signs.
Similarly,
$\int_{0}^{\inf TAB}$
gives
$\int_{0}^{$\infty$}$
Please find below the corresponding section from my .emacs file. I don't know any lisp.
(require 'auto-complete)
(require 'auto-complete-config)
(ac-config-default)
;; AucTex setup
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(require 'auto-complete-auctex)
;; Stop completion
(define-key ac-complete-mode-map "\M-/" 'ac-stop)
;; Now you can stop completion by pressing M-/.
;; Completion by TAB
;; -----------------
(define-key ac-complete-mode-map "\t" 'ac-complete)
(define-key ac-complete-mode-map "\r" nil)
;; Do What I Mean mode
;; -------------------
;; If DWIM (Do What I Mean) mode is enabled,
;; the following features is available:
;;
;; a. TAB (ac-expand) behave as completion (ac-complete)
;; when only one candidate is left
;; b. TAB (ac-expand) behave as completion (ac-complete)
;; after you select candidate
;; c. Disapear automatically when you
;; complete a candidate.
(setq ac-dwim t)
(setq ac-ignore-case nil) ; prevent autocomplete from changing capitalization