[Top][All Lists]

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

[elpa] externals/consult 9ff6dd0: consult-completion-in-region: Provide

From: ELPA Syncer
Subject: [elpa] externals/consult 9ff6dd0: consult-completion-in-region: Provide :annotation-function from :company-docsig
Date: Thu, 15 Jul 2021 04:57:09 -0400 (EDT)

branch: externals/consult
commit 9ff6dd0fffbf785ba3f1d914f6e285968fb4a9b7
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    consult-completion-in-region: Provide :annotation-function from 
 consult.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/consult.el b/consult.el
index 4c83f56..9fd491d 100644
--- a/consult.el
+++ b/consult.el
@@ -2092,7 +2092,17 @@ These configuration options are supported:
              (initial (buffer-substring-no-properties start end))
              (metadata (completion-metadata initial collection predicate))
              (threshold (or (plist-get config :cycle-threshold) 
(completion--cycle-threshold metadata)))
-             (all (completion-all-completions initial collection predicate 
(length initial))))
+             (all (completion-all-completions initial collection predicate 
(length initial)))
+             ;; Provide `:annotation-function' if `:company-docsig' is 
+             (completion-extra-properties
+              (if-let (fun (and (not (plist-get completion-extra-properties 
+                                (plist-get completion-extra-properties 
+                  `(:annotation-function
+                    ,(lambda (cand)
+                       (concat (propertize " " 'display '(space :align-to 
+                               (funcall fun cand)))
+                    ,@completion-extra-properties)
+                completion-extra-properties)))
     ;; error if `threshold' is t or the improper list `all' is too short
     (if (and threshold
             (or (not (consp (ignore-errors (nthcdr threshold all))))

reply via email to

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