branch: elpa/fedi
commit 26c4973c676db486f338eb516249bf72a65f69a9
Author: marty hiatt <martianhiatus [a t] riseup [d o t] net>
Commit: marty hiatt <martianhiatus [a t] riseup [d o t] net>

    add affix-/exit-fun args to return-capf
---
 fedi-post.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/fedi-post.el b/fedi-post.el
index ca7ca501c21..6ac05dd88d6 100644
--- a/fedi-post.el
+++ b/fedi-post.el
@@ -340,7 +340,8 @@ Federated user: `[email protected]`."
         (cons (match-beginning 2)
               (match-end 2))))))
 
-(defun fedi-post--return-capf (regex completion-fun annot-fun)
+(defun fedi-post--return-capf (regex completion-fun &optional
+                                     annot-fun affix-fun exit-fun)
   "Return a completion at point function.
 REGEX is used to get the item before point.
 COMPLETION-FUN takes two args, start and end bounds of item
@@ -362,6 +363,14 @@ for it."
                               (funcall completion-fun start end)))))
                  (and (consp result) result))))
             :exclusive 'no
+            ;; :affixation-function
+            ;; (lambda (cands)
+            ;; (funcall affix-fun cands))
+            ;; FIXME: we "should" use :affixation-function for this but i
+            ;; can't get it to work so use an exit-fun hack:
+            :exit-function
+            (lambda (str status)
+              (funcall exit-fun str status))
             :annotation-function
             (lambda (cand)
               (concat " " (funcall annot-fun cand)))))))

Reply via email to