emacs.d

My emacs configuration, done in a literate programming fashion using org-mode

git clone git://git.shimmy1996.com/emacs.d.git
commit 4ae2ca5296616d8846df22f9134fc5ac54b62537
parent dfea3fd29303a8aa6a38369b69683e705e837cc3
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Sat,  2 Jun 2018 18:53:25 -0500

Enable company-math only in TeX-mode.

Diffstat:
MREADME.org | 17++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/README.org b/README.org
@@ -811,13 +811,20 @@ Install =company-quickhelp= and set delay, FG/BG colors, max lines.
 #+END_SRC
 ** Backend Configurations
 *** =company-math=
-Install =company-math= and add it to =company-backends=.
+Install =company-math=.
 #+BEGIN_SRC emacs-lisp
   (use-package company-math
-    :ensure t
-    :init (add-to-list 'company-backends
-                       '(company-math-symbols-latex
-                         company-math-symbols-unicode)))
+    :ensure t)
+#+END_SRC
+
+Add it to =company-backends= when in =TeX-mode=.
+#+BEGIN_SRC emacs-lisp
+  (defun company-math-init ()
+    (setq-local company-backends
+                (append '((company-math-symbols-latex company-latex-commands))
+                        company-backends)))
+
+  (add-hook 'TeX-mode-hook 'company-math-init)
 #+END_SRC
 
 *** =company-auctex=