branch: master
commit 2a21bfd4422c74c817062eb935088376ac3d09dc
Author: Dmitry Gutov <[email protected]>
Commit: Dmitry Gutov <[email protected]>
Extract company--capf-post-completion, for easier debugging
---
company-capf.el | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/company-capf.el b/company-capf.el
index 06384c7..ffd9ea3 100644
--- a/company-capf.el
+++ b/company-capf.el
@@ -154,17 +154,20 @@
(plist-get (nthcdr 4 (company--capf-data)) :company-require-match))
(`init nil) ;Don't bother: plenty of other ways to initialize the
code.
(`post-completion
- (let* ((res (company--capf-data))
- (exit-function (plist-get (nthcdr 4 res) :exit-function))
- (table (nth 3 res))
- (pred (plist-get (nthcdr 4 res) :predicate)))
- (if exit-function
- ;; Follow the example of `completion--done'.
- (funcall exit-function arg
- (if (eq (try-completion arg table pred) t)
- 'finished 'sole)))))
+ (company--capf-post-completion arg))
))
+(defun company--capf-post-completion (arg)
+ (let* ((res (company--capf-data))
+ (exit-function (plist-get (nthcdr 4 res) :exit-function))
+ (table (nth 3 res))
+ (pred (plist-get (nthcdr 4 res) :predicate)))
+ (if exit-function
+ ;; Follow the example of `completion--done'.
+ (funcall exit-function arg
+ (if (eq (try-completion arg table pred) t)
+ 'finished 'sole)))))
+
(provide 'company-capf)
;;; company-capf.el ends here