[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 22/28: company--capf-data: use caching
From: |
Dmitry Gutov |
Subject: |
[elpa] 22/28: company--capf-data: use caching |
Date: |
Wed, 27 Aug 2014 01:26:32 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit d6e4cc24161fd727cc2256da038afa55c492d4a3
Author: Dmitry Gutov <address@hidden>
Date: Sun Aug 24 20:51:52 2014 +0400
company--capf-data: use caching
#170
---
company-capf.el | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/company-capf.el b/company-capf.el
index e27ae7a..b630025 100644
--- a/company-capf.el
+++ b/company-capf.el
@@ -28,7 +28,20 @@
(require 'company)
(require 'cl-lib)
+(defvar company--capf-cache nil)
+
(defun company--capf-data ()
+ (let ((cache company--capf-cache))
+ (if (and (equal (current-buffer) (car cache))
+ (equal (point) (car (setq cache (cdr cache))))
+ (equal (buffer-chars-modified-tick) (car (setq cache (cdr
cache)))))
+ (cadr cache)
+ (let ((data (company--capf-data-real)))
+ (setq company--capf-cache
+ (list (current-buffer) (point) (buffer-chars-modified-tick)
data))
+ data))))
+
+(defun company--capf-data-real ()
(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
- [elpa] 12/28: Tweak wording, (continued)
- [elpa] 12/28: Tweak wording, Dmitry Gutov, 2014/08/26
- [elpa] 13/28: Use `posn-actual-col-row' to determine the current col and row, Dmitry Gutov, 2014/08/26
- [elpa] 14/28: Work around http://debbugs.gnu.org/18285, Dmitry Gutov, 2014/08/26
- [elpa] 16/28: company-buffer-lines: handle multiline display better, Dmitry Gutov, 2014/08/26
- [elpa] 17/28: company-input-noop still seems to be needed in the terminal, Dmitry Gutov, 2014/08/26
- [elpa] 18/28: Skip company-buffer-lines tests in terminal, Dmitry Gutov, 2014/08/26
- [elpa] 19/28: company-pseudo-tooltip-unhide: use local vars, Dmitry Gutov, 2014/08/26
- [elpa] 20/28: company-pseudo-tooltip-unhide: fix rendering at eob, Dmitry Gutov, 2014/08/26
- [elpa] 15/28: Fix the tests, Dmitry Gutov, 2014/08/26
- [elpa] 21/28: Add a comment, Dmitry Gutov, 2014/08/26
- [elpa] 22/28: company--capf-data: use caching,
Dmitry Gutov <=
- [elpa] 24/28: Use `company-dabbrev-ignore-case' when searching for candidates, Dmitry Gutov, 2014/08/26
- [elpa] 25/28: Document `company-dabbrev-ignore-case' better, Dmitry Gutov, 2014/08/26
- [elpa] 26/28: company-dabbrev-code-ignore-case: rephrase a bit, Dmitry Gutov, 2014/08/26
- [elpa] 27/28: Bump the version, Dmitry Gutov, 2014/08/26
- [elpa] 28/28: Merge commit 'f4ffe2b47cf6854ff3bc3ca1717efe1258c01547' from company, Dmitry Gutov, 2014/08/26
- [elpa] 23/28: Fix WRT `keep-prefix', Dmitry Gutov, 2014/08/26