diff --git a/home-manager/modules/programs/emacs/emacs.d/lib/az_org.el b/home-manager/modules/programs/emacs/emacs.d/lib/az_org.el index a397124..86678c1 100644 --- a/home-manager/modules/programs/emacs/emacs.d/lib/az_org.el +++ b/home-manager/modules/programs/emacs/emacs.d/lib/az_org.el @@ -183,3 +183,12 @@ (turn-off-auto-fill) (flyspell-mode))) (add-hook 'org-after-todo-statistics-hook 'org-summary-todo))) + + +;; https://emacs.stackexchange.com/a/41619 +(defun az-markdown-convert-buffer-to-org () + "Convert the current buffer's content from markdown to orgmode format and save it with the current buffer's file name but with .org extension." + (interactive) + (shell-command-on-region (point-min) (point-max) + (format "pandoc -f markdown -t org -o %s" + (concat (file-name-sans-extension (buffer-file-name)) ".org"))))