lepisma / org-krita

Krita sketches in Org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix org-krita-insert-new-image

amoghpj opened this issue · comments

Hey, thanks for the neat tool! I couldn't get the 'org-krita-insert-new-image' to work interactively. I have reworked the function to remove the arguments, which fixes the issue.

@@ -182,16 +182,16 @@ If FULL-MODE is not null, run full krita."
       path)))
 
 ;;;###autoload
-(defun org-krita-insert-new-image (output-kra-path desc)
+(defun org-krita-insert-new-image ()
   "Insert new image in current buffer."
-  (interactive
-   (let ((output-kra-path (funcall org-krita-get-new-filepath))
-         (desc (funcall org-krita-get-new-desc)))
-     (list (org-krita-validate-path output-kra-path) desc)))
-  (org-krita-make-new-image output-kra-path)
-  (org-insert-link nil (concat "krita:" output-kra-path) desc)
-  ;; TODO: Enable only the new image
-  (org-krita-enable))
+  (interactive)
+  (let ((output-kra-path (funcall org-krita-get-new-filepath))
+        (desc (funcall org-krita-get-new-desc)))
+    (list (org-krita-validate-path output-kra-path) desc)
+    (org-krita-make-new-image output-kra-path)
+    (org-insert-link nil (concat "krita:" output-kra-path) desc)
+    ;; TODO: Enable only the new image
+    (org-krita-enable)))

wait what was the error that you were getting? i feel the older function should work