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:
parent
ece2f86480
commit
b1e23238e6
1 changed files with 5 additions and 4 deletions
|
@ -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)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue