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

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

[ELPA-diffs] [elpa] 08/14: Fix http://debbugs.gnu.org/16334


From: emacs-devel
Subject: [ELPA-diffs] [elpa] 08/14: Fix http://debbugs.gnu.org/16334
Date: Tue, 14 Jan 2014 20:57:10 +0000

This is an automated email from the git hooks/post-receive script.

root pushed a commit to branch master
in repository elpa.

commit fefcae59d66589e81823fe08c0b40a995d9118a4
Author: Dmitry Gutov <address@hidden>
Date:   Sun Jan 5 07:16:13 2014 +0400

    Fix http://debbugs.gnu.org/16334
---
 NEWS.md         |    1 +
 company-capf.el |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index ff598f7..ae1124c 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
 
 ## Next
 
+* `company-capf` supports completion tables that return non-default boundaries.
 * `company-elisp` is enabled in `inferior-emacs-lisp-mode`.
 
 ## 2013-09-28 (0.6.12)
diff --git a/company-capf.el b/company-capf.el
index 2d20bee..ee2ac1e 100644
--- a/company-capf.el
+++ b/company-capf.el
@@ -52,7 +52,14 @@ Requires Emacs 24.1 or newer."
                       (buffer-substring (nth 1 res) (nth 2 res))
                       table pred))
                 (sortfun (cdr (assq 'display-sort-function meta)))
+                (boundaries (completion-boundaries arg table pred ""))
                 (candidates (all-completions arg table pred)))
+           (unless (zerop (car boundaries))
+             (let ((before (substring arg 0 (car boundaries))))
+               (setq candidates
+                     (mapcar (lambda (candidate)
+                               (concat before candidate))
+                             candidates))))
            (if sortfun (funcall sortfun candidates) candidates)))))
     (`sorted
      (let ((res (company--capf-data)))

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.



reply via email to

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