branch: elpa/gnosis
commit 6d3192a6e317ce6e435761d0b92ff2237eb7c934
Author: Thanos Apollo <pub...@thanosapollo.org>
Commit: Thanos Apollo <pub...@thanosapollo.org>

    New function: Add gnosis-display-image.
    
    + Extract image path from file link in keimenon and open in a
      new window.
---
 gnosis.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnosis.el b/gnosis.el
index d6642a18a3..187b71ccdb 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -384,6 +384,13 @@ This will not be applied to sentences that start with 
double space."
   (gnosis-insert-separator)
   (gnosis-apply-center-buffer-overlay))
 
+(defun gnosis-display-image (keimenon)
+  "Dipslay image link from KEIMENON in new window."
+  (let ((image-path (and (string-match "\\[file:\\(.*?\\)\\]" keimenon)
+                        (match-string 1 keimenon))))
+    (when image-path
+      (find-file-other-window image-path)
+      (switch-to-buffer-other-window gnosis-review-buffer-name))))
 
 (defun gnosis-trim-quotes (str)
   "Remove prefix and suffxi quotes for STR."

Reply via email to