diff options
author | Thanos Apollo <[email protected]> | 2024-02-28 00:27:42 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-02-28 00:27:42 +0200 |
commit | aa3c2f8f5815f01da1f2d6ce50c7dc6d24beb075 (patch) | |
tree | d9142fa1b8cdbe5bc8721ef1175fa90677f0337b | |
parent | 6ee271486b9a2c1467434bf6c23cb804f905a0f2 (diff) |
gnosis-display-image: Refactor
gnosis-display-image now takes image to display as argument. This
should allow gnosis-display-image to be used with extra-image
-rw-r--r-- | gnosis.el | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -333,9 +333,17 @@ If FALSE t, use gnosis-face-false face" (insert (propertize "\n\n-----\n" 'face 'gnosis-face-seperator)) (fill-paragraph (insert "\n" (propertize extras 'face 'gnosis-face-extra))))) -(defun gnosis-display-image (id) - "Display image for note ID." - (let* ((img (gnosis-get 'images 'extras `(= id ,id))) +(cl-defun gnosis-display-image (id &optional (image 'images)) + "Display image for note ID. + +IMAGE is the image type to display, should be either `images' or +`extra-image'. + +`images' is the image to display before user-input, while +`extra-image' is the image to display after user-input. + +Refer to `gnosis-db-schema-extras' for more." + (let* ((img (gnosis-get image 'extras `(= id ,id))) (path-to-image (expand-file-name (or img "") (file-name-as-directory gnosis-images-dir))) (image (create-image path-to-image 'png nil :width gnosis-image-width :height gnosis-image-height))) (when img |