emacs.d

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

git clone git://git.shimmy1996.com/emacs.d.git
commit d8785dc4d934e2a5b58bcf8711f9fe07828bc6e9
parent fec79cb5610d8a1bb7c69c33f1fcb9aeb6d19b68
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Sun, 31 Mar 2019 13:11:09 -0400

Yas-ify company backends everytime we enter yas-minor-mode.

Diffstat:
MREADME.org | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/README.org b/README.org
@@ -592,7 +592,7 @@ Company completion via =company-lsp=.
 #+END_SRC
 
 **** =company-yasnippet=
-Add =company-yasnippet= backend for =yasnippet= key completion. Run this last to ensure coverage.
+Add =company-yasnippet= backend for =yasnippet= key completion.
 #+BEGIN_SRC emacs-lisp
   (defun user/enable-yas-for-backend (backend)
     "Add yasnippet support for specified BACKEND."
@@ -600,8 +600,12 @@ Add =company-yasnippet= backend for =yasnippet= key completion. Run this last to
         backend
       (append (if (consp backend) backend (list backend))
               '(:with company-yasnippet))))
-  ;; Enable for all backends.
-  (setq company-backends (mapcar #'user/enable-yas-for-backend company-backends))
+
+  ;; Enable for all company backends. Add to hook to prevent missed backends.
+  (add-hook 'yas-minor-mode-hook
+            (lambda()
+              (setq company-backends
+                    (mapcar #'user/enable-yas-for-backend company-backends))))
 #+END_SRC
 
 *** =yasnippet= Conflict