diff options
author | Thanos Apollo <[email protected]> | 2023-12-30 11:20:22 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-30 11:20:22 +0200 |
commit | 942e58e47e6a2924ce8bb3cd6e8367e9932c8c96 (patch) | |
tree | ba4952316f12a24cd05b88ace100c6c85bda974a /gnosis.el | |
parent | 9bd366ef4e33a70d205003e06cf92c6af3832b7c (diff) |
Add gnosis-select-image
Prompt user to select image from gnosis-images-dir and return it's
path as a string.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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) |