From d9f439e47f352cc16bf69c9e4d24ed577ae92ad7 Mon Sep 17 00:00:00 2001 From: Protesilaos Stavrou Date: Tue, 14 Jun 2022 18:30:56 +0300 Subject: [PATCH] Add helper function to prepare completion table --- denote.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/denote.el b/denote.el index 6bbd58c..9690fd5 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))