Add helper function to prepare completion table

This commit is contained in:
Protesilaos Stavrou 2022-06-14 18:30:56 +03:00
parent d66312e517
commit d9f439e47f
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -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))