diff options
author | Thanos Apollo <[email protected]> | 2024-02-28 01:54:27 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-02-28 01:54:27 +0200 |
commit | 6d6d58a93ea647cca16ec5f9b60ff41058a3dc75 (patch) | |
tree | 76766697f49520fe58e66080aa41bbb594dc7b15 /gnosis.el | |
parent | 042079c20223a0075f0a6c53e8f6f59f04872103 (diff) |
gnosis-select-images: Refactor
Refactor gnsois-select-images to prompt to select for extra-image as
well, returns a cons (image . second-images).
This way we won't have to recreate a needless function like
gnosis-select-second-image.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -782,15 +782,20 @@ By default, DIR value is `gnosis-images-dir' & REGEX value is \"^[^.]\"" else if (string-match-p regex (file-name-nondirectory path)) collect (list (file-relative-name path dir)))))) -(defun gnosis-select-image (&optional prompt) +(defun gnosis-select-images (&optional prompt) "Return PATH for file in `gnosis-images-dir'. Optionally, add cusotm PROMPT." - (if (y-or-n-p "Add image?") + (if (y-or-n-p "Include images?") (let* ((prompt (or prompt "Select image: ")) - (image (funcall gnosis-completing-read-function prompt - (cons nil (gnosis-directory-files gnosis-images-dir))))) - (if (string= image "nil") nil image)) + (image (if (y-or-n-p "Add review image?") + (funcall gnosis-completing-read-function prompt + (cons nil (gnosis-directory-files gnosis-images-dir))) + nil)) + (extra-image (if (y-or-n-p "Add post review image?") + (funcall gnosis-completing-read-function prompt + (cons nil (gnosis-directory-files gnosis-images-dir)))))) + (cons image extra-image)) nil)) (defun gnosis-get-tags--unique () |