title: emacs latex hooks not running
body: <p>So for some reason some of my hooks for latex mode with auctex in emacs refuse to run but give no errors (at least none I can see in messages buffer). This is most of the stuff in my .emacs about latex (other than some keyword definitions, etc...). I'm running Emacs24.2 on Arch Linux with the latest version of auctex as well. Been wrestling with this for a while now and as far as I can remember this used to work just fine until today I noticed that flyspell and auto fill weren't being set automatically (has probably been happening for a while at this rate since I haven't use auctex in a while).</p>
  
  <p><pre><code>
  (add-to-list 'load-path "~/Dropbox/Emacs/")
  (add-to-list 'load-path "~/Dropbox/Emacs/git/")
  (add-to-list 'load-path "~/Dropbox/Emacs/magit/")
  (add-to-list 'load-path "~/Dropbox/Emacs/GLSL/")</p>
  
  <p>;; auto-complete
  (require 'auto-complete)
  (require 'auto-complete-config)
  (require 'auto-complete-clang)
  (ac-flyspell-workaround)
  (add-to-list 'ac-modes 'LaTeX-mode)
  (ac-config-default)
  (setq ac-quick-help-delay 0)
  (define-key ac-mode-map  [(control tab)] 'auto-complete)
  (setq-default ac-sources
            '(ac-source-abbrev ac-source-dictionary
                   ac-source-words-in-same-mode-buffers))
  (global-auto-complete-mode t)
  (add-hook 'emacs-lisp-mode-hook
        (lambda  ()
          (add-to-list 'ac-sources 'ac-source-symbols 'ac-source-variables)))
  (defun add-sources-c-modes ()
    (add-to-list 'ac-sources 'ac-source-semantic 'ac-source-clang))
  (add-hook 'c-mode-hook 'add-sources-c-modes)
  (add-hook 'c++-mode-hook 'add-sources-c-modes)
  (define-key ac-completing-map "\C-n" 'ac-next)
  (define-key ac-completing-map "\C-p" 'ac-previous)</p>
  
  <p>;; DocView
  (setq doc-view-continuous t)
  (setq doc-view-resolution 300)</p>
  
  <p>;; diff mode colors
  (eval-after-load 'diff-mode
    '(progn
       (set-face-foreground 'diff-added "green")
       (set-face-foreground 'diff-header "purple")
       (set-face-foreground 'diff-removed "red")))</p>
  
  <p>;; dired colors
  (eval-after-load 'dired-mode
    '(progn
       (set-face-foreground 'dired-directory "cyan")
       (set-face-foreground 'dired-flagged "red")
       (set-face-foreground 'dired-header "purple")))</p>
  
  <p>;; server mode
  ;; (server-start)</p>
  
  <p>;; GLSL
  (autoload 'glsl-mode "glsl-mode" nil t)
  (add-to-list 'auto-mode-alist '("\.vert\'" . glsl-mode))
  (add-to-list 'auto-mode-alist '("\.frag\'" . glsl-mode))</p>
  
  <p>;; Git / SVN
  (require 'git)
  (require 'git-blame)</p>
  
  <p>;; Emacs Code Browser / CEDET
  ;; (require 'cedet)
  ;; (require 'ecb)
  ;; (setq ecb-options-version "2.40")</p>
  
  <p>;; Close scratch buffer on startup
  (defun close-scratch-hook ()
    (kill-buffer "<em>scratch</em>"))
  (add-hook 'emacs-startup-hook 'close-scratch-hook)</p>
  
  <p>;; LaTeX/Auctex settings
  (require 'ac-math)
  (defun ac-latex-mode-setup ()
    (add-to-list 'ac-sources 'ac-source-math-unicode 'ac-source-math-latex
             'ac-source-latex-commands))
  (add-hook 'LaTeX-mode-hook 'latex-math-mode)
  (add-hook 'LaTeX-mode-hook 'turn-on-reftex)
  (add-hook 'text-mode-hook 'auto-fill-mode)
  (add-hook 'LaTeX-mode-hook 'turn-on-flyspell)
  (add-hook 'LaTeX-mode-hook 'ac-latex-mode-setup)
  (add-hook 'LaTeX-mode-hook
        (lambda ()
           (set-face-foreground 'font-latex-sedate-face "cyan")))
  (setq reftex-plug-into-AUCTeX t)
  (setq font-latex-match-slide-title-keywords (quote (("frametitle" "{"))))
  (setq font-latex-match-warning-keywords (quote ("hline" "pause" "and" "hfill")))
  (setq font-latex-match-function-keywords
        (quote
         (("titlepage" "") ("maketitle" "") ("frame" "") ("tableofcontents" "")
      ("noindent" "") ("usetheme" "{") ("usecolortheme" "{") ("institute" "[{")
      ("includegraphics" "[{") ("title" "[{") ("href" "{{") ("url" "{") ("hypersetup" "{")
      ("useoutertheme" "{") ("useinnertheme" "{") ("setbeamercolor" "{{")
      ("setbeamertemplate" "{{") ("setdescription" "{") ("lstset" "{") ("lstinputlisting" "[{")
      ("textcolor" "{") ("verbatiminput" "{") ("graphicspath" "{")
      ("fancyhead" "[{") ("fancyfoot" "[{") ("fontsize" "{{") ("doublespacing" ""))))</p>
  
  <p>;; Line numbers
  (require 'linum)
  (global-linum-mode t)</p>
  
  <p>;; Disable line numbers in certain buffers
  (defcustom linum-disabled-modes-list '(eshell-mode wl-summary-mode compilation-mode org-mode dired-mode)
    "* List of modes disabled when global linum mode is on"
    :type '(repeat (sexp :tag "Major mode"))
    :tag " Major modes where linum is disabled: "
    :group 'linum)</p>
  
  <p>(defcustom linum-disable-starred-buffers 't
    "* Disable buffers that have stars in them like <em>Gnu Emacs</em>"
    :type 'boolean
    :group 'linum)</p>
  
  <p>(defun linum-on ()
    "* When linum is running globally, disable line number in modes defined in `linum-disabled-modes-list'. Changed by linum-off. Also turns off numbering in starred modes like <em>scratch</em>"
    (unless (or (minibufferp) (member major-mode linum-disabled-modes-list)
            (and linum-disable-starred-buffers (string-match "*" (buffer-name))))
      (linum-mode 1)))</p>
  
  <p>;; Basic emacs settings
  (setq initial-scratch-buffer nil)
  (setq inhibit-splash-screen t)
  (setq inhibit-startup-message t)
  (setq-default truncate-lines t)
  (setq backup-inhibited t)
  (setq auto-save-default nil)
  (setq compilation-scroll-output t)
  (if (boundp 'scroll-bar-mode) (scroll-bar-mode -1))
  (column-number-mode 1)
  (setq-default fill-column 80)
  (setq auto-fill-mode 1)
  (if (boundp 'tool-bar-mode) (tool-bar-mode 0))
  (set-face-attribute 'default nil :height 100)
  (add-hook 'before-save-hook 'delete-trailing-whitespace)
  (global-auto-revert-mode t)
  (setq frame-title-format "%b")</p>
  
  <p>;; cscope
  (require 'xcscope)
  (setq cscope-do-not-update-database t)</p>
  
  <p>;; Enable these to speed up compiler output
  ;; (setq compilation-error-regexp-alist nil)
  ;; (setq compilation-error-regexp-alist-alist nil)</p>
  
  <p>;; Indentation rules
  (setq c-default-style "bsd" c-basic-offset 4)
  (c-set-offset 'case-label '+)
  (setq sgml-basic-offset 4)
  (setq python-indent 4)
  (setq indent-tabs-mode nil)
  (setq tab-always-indent t)
  (setq tab-width 4)
  (setq tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52
                    56 60 64 68 72 76 80 84 88 92 96
                    100 104 108 112 116 120)))</p>
  
  <p>;; highlight matching parentheses
  (show-paren-mode 1)
  (setq show-paren-delay 0)</p>
  
  <p>;; highlight current line
  (global-hl-line-mode 1)
  (set-face-background 'hl-line "#300")</p>
  
  <p>;; C-Sharp mode
  ;; (require 'cc-mode)
  ;; (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
  ;; (add-to-list 'auto-mode-alist '("\.cs$" . csharp-mode))</p>
  
  <p>;; Change the color scheme
  (require 'color-theme)
  (color-theme-initialize)
  (color-theme-midnight)</p>
  
  <p>;; Make ENTER automatically indent in C derived buffers
  (add-hook 'c-mode-common-hook
        (lambda ()
           (local-set-key (kbd "RET") 'newline-and-indent)))</p>
  
  <p>;; Enable terminal colors
  (autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
  (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)</p>
  
  <p>;; Hotkeys
  (global-set-key [f9] 'compile)</p>
  
  <p>;; Emacs IRC
  (setq erc-auto-query 'buffer)</p>
  
  <p>;; assembly mode
  (add-hook 'asm-mode-hook
        (lambda ()
           (local-set-key (kbd "RET") 'newline)))</p>
  
  <p>;; change default Browser
  (setq browse-url-generic-program (executable-find "chromium")
        browse-url-browser-function 'browse-url-generic)</p>
  
  <p>;; multi-term
  (require 'multi-term)</p>
  
  <p>;; yasnippet work around
  ;; (add-hook 'change-major-mode-hook 'yas/exit-all-snippets)</p>
  
  <p>;; develock
  (require 'develock)
  </pre></code></p>