]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/company/company-capf.el
* wcheck-mode: New package.
[gnu-emacs-elpa] / packages / company / company-capf.el
index 3aaeb137a8000550d61b5be4388651cb6a775235..cc075df2017e0e04c675ad324763a7c6a4ef026a 100644 (file)
 
 ;;; Code:
 
+(require 'company)
 (require 'cl-lib)
 
-(defvar company--capf-data nil)
-(make-variable-buffer-local 'company--capf-data)
+(defvar-local company--capf-data nil)
 
 (defun company--capf-clear-data (&optional _ignore)
   (setq company--capf-data nil)
   (remove-hook 'company-completion-finished-hook 'company--capf-clear-data t))
 
 (defun company--capf-data ()
-  ;; Ignore tags-completion-at-point-function because it subverts company-etags
-  ;; in the default value of company-backends, where the latter comes later.
-  (cl-letf* (((default-value 'completion-at-point-functions) nil)
+  (cl-letf* (((default-value 'completion-at-point-functions)
+              ;; Ignore tags-completion-at-point-function because it subverts
+              ;; company-etags in the default value of company-backends, where
+              ;; the latter comes later.
+              (remove 'tags-completion-at-point-function
+                      (default-value 'completion-at-point-functions)))
              (data (run-hook-wrapped 'completion-at-point-functions
                                      ;; Ignore misbehaving functions.
                                      #'completion--capf-wrapper 'optimist)))