emacs.d

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

git clone git://git.shimmy1996.com/emacs.d.git
commit 9995b4dcd311d976da12ad3e9beb822a8ce2dd70
parent 4ae2ca5296616d8846df22f9134fc5ac54b62537
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Sat,  2 Jun 2018 23:56:19 -0500

Enable company-semantic.

Diffstat:
MREADME.org | 40++++++++++++----------------------------
1 file changed, 12 insertions(+), 28 deletions(-)
diff --git a/README.org b/README.org
@@ -747,7 +747,7 @@ Install =company= and enable it globally.
 Set delay for auto-completion. 0 would be too extreme and wastes CPU clocks apparently.
 #+BEGIN_SRC emacs-lisp
   (setq company-idle-delay 0.01)
-  (setq company-minimum-prefix-length 1)
+  (setq company-minimum-prefix-length 2)
 #+END_SRC
 
 ** =yasnippet= Conflict
@@ -781,15 +781,6 @@ the only fix that I found that makes everything work as expected.
   (global-set-key [tab] 'tab-indent-or-complete)
 #+END_SRC
 
-** Removing =company-semantic= backend
-So, =cedet= has this thing called =semantic=, which sounds great and
-seems really clever, but it's slow. Usually using a backend specific
-for the language you're using provides more satisfying results.
-
-#+BEGIN_SRC emacs-lisp
-  (with-eval-after-load 'company
-    '(setq company-backends (delete 'company-semantic company-backends)))
-#+END_SRC
 ** Tooltip Documentation
 Install dependency =pos-tip=.
 #+BEGIN_SRC emacs-lisp
@@ -811,17 +802,21 @@ Install =company-quickhelp= and set delay, FG/BG colors, max lines.
 #+END_SRC
 ** Backend Configurations
 *** =company-math=
-Install =company-math=.
+Install =company-math= and add it to =company-backends=.
+
+Enable unicode symbol backend globally.
 #+BEGIN_SRC emacs-lisp
-  (use-package company-math
-    :ensure t)
+   (use-package company-math
+     :ensure t
+     :init (add-to-list 'company-backends
+                        '(company-math-symbols-unicode)))
 #+END_SRC
 
-Add it to =company-backends= when in =TeX-mode=.
+Enable math symbol backend only in =TeX-mode=.
 #+BEGIN_SRC emacs-lisp
   (defun company-math-init ()
     (setq-local company-backends
-                (append '((company-math-symbols-latex company-latex-commands))
+                (append '((company-math-symbols-latex))
                         company-backends)))
 
   (add-hook 'TeX-mode-hook 'company-math-init)
@@ -837,21 +832,10 @@ Adding backends is handled by =company-auctex-init=.
 #+END_SRC
 *** =company-yasnippet=
 Add =company-yasnippet= backend for =yasnippet= key completion.
-Keep this at the end to enable this for all backends.
 #+BEGIN_SRC emacs-lisp
-  ;; Add yasnippet support for all company backends
-  ;; https://github.com/syl20bnr/spacemacs/pull/179
-  (defvar company-mode/enable-yas t
-    "Enable yasnippet for all backends.")
-
-  (defun company-mode/backend-with-yas (backend)
-    (if (or (not company-mode/enable-yas) (and (listp backend) (member 'company-yasnippet backend)))
-        backend
-      (append (if (consp backend) backend (list backend))
-              '(:with company-yasnippet))))
-
-  (setq company-backends (mapcar #'company-mode/backend-with-yas company-backends))
+  (push '(company-semantic :with company-yasnippet) company-backends)
 #+END_SRC
+
 * ESS
 Emacs Speaks Statistics (ESS) is an add-on package for emacs text editors such as GNU Emacs and XEmacs. It is designed to support editing of scripts and interaction with various statistical analysis programs such as R, S-Plus, SAS, Stata and OpenBUGS/JAGS.