]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix company-yasnippet compilation without yasnippet
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 19 Sep 2014 02:39:48 +0000 (06:39 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 19 Sep 2014 02:39:48 +0000 (06:39 +0400)
Closes #187

company-yasnippet.el

index 741a160086707a5ed25c4681a63f0c7bd4488c02..f0a7c380d9d4c9a69599bf9c9a87131aebd5892b 100644 (file)
 
 ;;; Code:
 
+(require 'company)
 (require 'cl-lib)
-(require 'yasnippet)
+
+(declare-function yas--table-hash "yasnippet")
+(declare-function yas--get-snippet-tables "yasnippet")
+(declare-function yas-expand-snippet "yasnippet")
+(declare-function yas--template-content "yasnippet")
+(declare-function yas--template-expand-env "yasnippet")
 
 (defun company-yasnippet--candidates (prefix)
-  (mapcan
+  (cl-mapcan
    (lambda (table)
      (let ((keyhash (yas--table-hash table))
            res)
@@ -80,7 +86,7 @@ shadow back-ends that come after it.  Recommended usages:
     (prefix
      ;; Should probably use `yas--current-key', but that's bound to be slower.
      ;; How many trigger keys start with non-symbol characters anyway?
-     (and yas-minor-mode
+     (and (bound-and-true-p yas-minor-mode)
           (company-grab-symbol)))
     (annotation
      (concat