Make pandoc conversion arguments customisable

This commit is contained in:
TEC 2024-04-11 11:42:05 +08:00
parent bc91164151
commit 6b8166553d
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 10 additions and 2 deletions

View File

@ -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-args)
(deactivate-mark) (goto-char (point-max)))
(cond ((bound-and-true-p evil-local-mode) (evil-insert-state))))