]> code.delx.au - gnu-emacs-elpa/blobdiff - company-capf.el
Merge pull request #101 from bbatsov/master
[gnu-emacs-elpa] / company-capf.el
index eeb543b22e1d23d4fb148927943f33c222b2bf10..04f8413edffbccfea75430785579585e57d4abfa 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)
@@ -88,7 +88,7 @@ Requires Emacs 24.1 or newer."
                       (buffer-substring (nth 1 res) (nth 2 res))
                       (nth 3 res) (plist-get (nthcdr 4 res) :predicate))))
            (cdr (assq 'display-sort-function meta))))))
-    (`common-part
+    (`match
      ;; Can't just use 0 when base-size (see above) is non-zero.
      (let ((start (if (get-text-property 0 'font-lock-face arg)
                       0