]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/company/company-capf.el
Merge commit '51c140ca9ee32d27cacc7b2b07d4539bf98ae575' from company-master
[gnu-emacs-elpa] / packages / company / company-capf.el
index 17be772126736ab282b2524fd509c8cc190a9c7f..3aaeb137a8000550d61b5be4388651cb6a775235 100644 (file)
@@ -25,7 +25,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))
+(require 'cl-lib)
 
 (defvar company--capf-data nil)
 (make-variable-buffer-local 'company--capf-data)
 (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.
-  (letf* (((default-value 'completion-at-point-functions) nil)
-          (data (run-hook-wrapped 'completion-at-point-functions
-                                  ;; Ignore misbehaving functions.
-                                  #'completion--capf-wrapper 'optimist)))
+  (cl-letf* (((default-value 'completion-at-point-functions) nil)
+             (data (run-hook-wrapped 'completion-at-point-functions
+                                     ;; Ignore misbehaving functions.
+                                     #'completion--capf-wrapper 'optimist)))
     (when (and (consp (cdr data)) (numberp (nth 1 data))) data)))
 
 (defun company-capf (command &optional arg &rest _args)
-  "`company-mode' back-end using `completion-at-point-functions'.
-Requires Emacs 24.1 or newer."
+  "`company-mode' back-end using `completion-at-point-functions'."
   (interactive (list 'interactive))
   (pcase command
     (`interactive (company-begin-backend 'company-capf))