From 1e4710537e70ca7d17fcedf61967d947406d94d4 Mon Sep 17 00:00:00 2001 From: MitchMarq42 Date: Wed, 8 Mar 2023 08:58:30 -0900 Subject: [PATCH] Add function for inlining an edraw file --- lisp/mitch-packages.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/mitch-packages.el b/lisp/mitch-packages.el index 191e3d3..326890e 100644 --- a/lisp/mitch-packages.el +++ b/lisp/mitch-packages.el @@ -59,8 +59,21 @@ :after org :config (require 'edraw-org) - (edraw-org-setup-default)) + (edraw-org-setup-default) + ;; following function taken from https://github.com/wn/doom.d/blob/46ca46f2ef21e933fb76b1568be1a62b262ed288/config.el#L47 + (defun org-mode-open-edraw (&optional filename) + (interactive) + (let ((filename (or filename + (concat "./" + (file-relative-name + (read-file-name (edraw-msg "Write svg file: ") + default-directory) + default-directory))))) + (insert (format "[[edraw:file=%s]]" filename)) + (backward-char) + (org-return)))) + ;; diminish (use-package diminish)