branch: externals/denote
commit d9f439e47f352cc16bf69c9e4d24ed577ae92ad7
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Add helper function to prepare completion table
---
 denote.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/denote.el b/denote.el
index 6bbd58c103..9690fd547d 100644
--- a/denote.el
+++ b/denote.el
@@ -221,6 +221,13 @@ We consider those characters illigal for our purposes.")
 
 ;;;; File helper functions
 
+(defun denote--completion-table (category candidates)
+  "Pass appropriate metadata CATEGORY to completion CANDIDATES."
+  (lambda (string pred action)
+    (if (eq action 'metadata)
+        `(metadata (category . ,category))
+      (complete-with-action action candidates string pred))))
+
 (defun denote-directory ()
   "Return path of variable `denote-directory' as a proper directory."
   (let ((path denote-directory))

Reply via email to