From 4ede32d859970216b6e3417dfd1753f2afbf9796 Mon Sep 17 00:00:00 2001 From: TEC Date: Thu, 11 Apr 2024 11:42:05 +0800 Subject: [PATCH] Make pandoc conversion arguments customisable --- emacs-everywhere.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/emacs-everywhere.el b/emacs-everywhere.el index df8ed47..be8d0a0 100644 --- a/emacs-everywhere.el +++ b/emacs-everywhere.el @@ -197,6 +197,12 @@ Set to nil to disable." :type '(repeat regexp) :group 'emacs-everywhere) +(defcustom emacs-everywhere-pandoc-md-args + '("-f" "markdown-auto_identifiers" "-t" "org") + "Arguments supplied to pandoc when converting text from Markdown to Org." + :type '(repeat string) + :group 'emacs-everywhere) + (defcustom emacs-everywhere-clipboard-sleep-delay 0.01 "Waiting period to wait to propagate clipboard actions." :type 'number @@ -631,8 +637,10 @@ return windowTitle")) (when (and (eq major-mode 'org-mode) (emacs-everywhere-markdown-p) (executable-find "pandoc")) - (shell-command-on-region (point-min) (point-max) - "pandoc -f markdown-auto_identifiers -t org" nil t) + (apply #'call-process-region + (point-min) (point-max) "pandoc" + nil nil nil + emacs-everywhere-pandoc-md-args) (deactivate-mark) (goto-char (point-max))) (cond ((bound-and-true-p evil-local-mode) (evil-insert-state))))