summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index 44e7100..0eef228 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -474,6 +474,15 @@ By default, DIR value is `gnosis-images-dir' & REGEX value is \"^[^.]\""
(gnosis-directory-files path regex))
else if (string-match-p regex (file-name-nondirectory path))
collect (list (file-relative-name path dir))))))
+
+(defun gnosis-select-image (&optional prompt)
+ "Return PATH for file in `gnosis-images-dir'.
+
+Optionally, add cusotm PROMPT."
+ (let* ((prompt (or prompt "Select image: "))
+ (image (completing-read prompt (gnosis-directory-files gnosis-images-dir))))
+ image))
+
(defun gnosis-get-tags--unique ()
"Return a list of unique strings for tags in gnosis-db."
(cl-loop for tags in (gnosis-select 'tags 'notes)