Skip to content

Commit

Permalink
Make pandoc conversion arguments customisable
Browse files Browse the repository at this point in the history
  • Loading branch information
tecosaur committed Apr 11, 2024
1 parent bc91164 commit 4ede32d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions emacs-everywhere.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))))

Expand Down

0 comments on commit 4ede32d

Please sign in to comment.