emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 9e844d1 124/173: Merge pull request #459 from fbergroth/pr


From: Dmitry Gutov
Subject: [elpa] master 9e844d1 124/173: Merge pull request #459 from fbergroth/prefix-length-var
Date: Thu, 23 Jun 2016 00:28:44 +0000 (UTC)

branch: master
commit 9e844d1c112005d734219da3885881325ff24bfe
Merge: 1221739 4cd4c3a
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Merge pull request #459 from fbergroth/prefix-length-var
    
    Turn :company-prefix-length property into a value
---
 NEWS.md         |    2 +-
 company-capf.el |    9 +++------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index 33750f1..87ea896 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -5,7 +5,7 @@
 * `company-semantic-insert-arguments`: New option. Like in `company-clang`.
 * `company-semantic-begin-after-member-access`: New option. Similar to the one
   in `company-clang`.
-* `company-capf` accepts `:company-prefix-length` property function.
+* `company-capf` accepts `:company-prefix-length` property value.
 * New face `company-tooltip-annotation-selection`, used for the annotation in
   the selected tooltip line.
 * `company-clang-objc-templatify` has been renamed to
diff --git a/company-capf.el b/company-capf.el
index 6554782..9eeb248 100644
--- a/company-capf.el
+++ b/company-capf.el
@@ -72,13 +72,10 @@
     (`prefix
      (let ((res (company--capf-data)))
        (when res
-         (let* ((f (plist-get (nthcdr 4 res) :company-prefix-length))
-                (beg (nth 1 res))
-                (end (nth 2 res))
-                (length (and f (funcall f beg (point))))
-                (prefix (buffer-substring-no-properties beg (point))))
+         (let ((length (plist-get (nthcdr 4 res) :company-prefix-length))
+               (prefix (buffer-substring-no-properties (nth 1 res) (point))))
            (cond
-            ((> end (point)) 'stop)
+            ((> (nth 2 res) (point)) 'stop)
             (length (cons prefix length))
             (t prefix))))))
     (`candidates



reply via email to

[Prev in Thread] Current Thread [Next in Thread]