lang/markdown: generalize markdown compile fn

So it can be used with the original perl script, discout, or the renamed
executable on MacOS.
This commit is contained in:
Henrik Lissner 2019-05-21 17:14:10 -04:00
parent ece2f86480
commit b1e23238e6
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -77,10 +77,11 @@ Returns its exit code."
;;;###autoload ;;;###autoload
(defun +markdown-compile-markdown (beg end output-buffer) (defun +markdown-compile-markdown (beg end output-buffer)
"Compiles markdown using the markdown program, if available. "Compiles markdown using the Markdown.pl script (or markdown executable), if
Returns its exit code." available. Returns its exit code."
(when (executable-find "markdown") (when-let* ((exe (or (executable-find "Markdown.pl")
(executable-find "markdown"))))
(call-process-region beg end (call-process-region beg end
shell-file-name nil output-buffer nil shell-file-name nil output-buffer nil
shell-command-switch shell-command-switch
"markdown"))) exe)))