[Top][All Lists]

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

[ELPA-diffs] ELPA branch, master, updated. 7ff5dc6402198c358bfbbfe5b620f

From: Stefan Monnier
Subject: [ELPA-diffs] ELPA branch, master, updated. 7ff5dc6402198c358bfbbfe5b620f23c459bca14
Date: Thu, 29 Aug 2013 19:14:32 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "ELPA".

The branch, master has been updated
       via  7ff5dc6402198c358bfbbfe5b620f23c459bca14 (commit)
      from  a8eda6e7dfd43b448119fd3b607dc6c5c9af5c5c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7ff5dc6402198c358bfbbfe5b620f23c459bca14
Author: Stefan Monnier <address@hidden>
Date:   Thu Aug 29 15:14:18 2013 -0400

    * packages/company/company-capf.el (company-capf): Add preliminary support 
    doc-buffer, meta, location, and require-match.

diff --git a/packages/company/company-capf.el b/packages/company/company-capf.el
index 60e4494..2d20bee 100644
--- a/packages/company/company-capf.el
+++ b/packages/company/company-capf.el
@@ -35,40 +35,47 @@
   "`company-mode' back-end using `completion-at-point-functions'.
 Requires Emacs 24.1 or newer."
   (interactive (list 'interactive))
-  (case command
-    (interactive (company-begin-backend 'company-capf))
-    (prefix
+  (pcase command
+    (`interactive (company-begin-backend 'company-capf))
+    (`prefix
      (let ((res (company--capf-data)))
        (when res
          (if (> (nth 2 res) (point))
            (buffer-substring-no-properties (nth 1 res) (point))))))
-    (candidates
+    (`candidates
      (let ((res (company--capf-data)))
        (when res
          (let* ((table (nth 3 res))
                 (pred (plist-get (nthcdr 4 res) :predicate))
                 (meta (completion-metadata
-                       (buffer-substring (nth 1 res) (nth 2 res))
-                       table pred))
+                      (buffer-substring (nth 1 res) (nth 2 res))
+                      table pred))
                 (sortfun (cdr (assq 'display-sort-function meta)))
                 (candidates (all-completions arg table pred)))
            (if sortfun (funcall sortfun candidates) candidates)))))
-    (sorted
+    (`sorted
      (let ((res (company--capf-data)))
        (when res
          (let ((meta (completion-metadata
                       (buffer-substring (nth 1 res) (nth 2 res))
                       (nth 3 res) (plist-get (nthcdr 4 res) :predicate))))
            (cdr (assq 'display-sort-function meta))))))
-    (duplicates nil)     ;Don't bother.
-    (no-cache t)         ;FIXME: Improve!
-    (meta nil)           ;FIXME: Return one-line docstring for `arg'.
-    (doc-buffer nil)     ;FIXME: Return help buffer for `arg'.
-    (location nil)       ;FIXME: Return (BUF . POS) or (FILE . LINENB) of 
-    (require-match nil)  ;Front-ends should also have a say in this.
-    (init nil)       ;Don't bother: plenty of other ways to initialize the 
-    (post-completion
+    (`duplicates nil) ;Don't bother.
+    (`no-cache t)     ;FIXME: Improve!
+    (`meta
+     (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-docsig)))
+       (when f (funcall f arg))))
+    (`doc-buffer
+     (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-doc-buffer)))
+       (when f (funcall f arg))))
+    (`location
+     (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-location)))
+       (when f (funcall f arg))))
+    (`require-match
+     (plist-get (nthcdr 4 (company--capf-data)) :company-require-match))
+    (`init nil)      ;Don't bother: plenty of other ways to initialize the 
+    (`post-completion
      (let* ((res (company--capf-data))
             (exit-function (plist-get (nthcdr 4 res) :exit-function)))
        (if exit-function


Summary of changes:
 packages/company/company-capf.el |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)


reply via email to

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