From a6ebd95aeeab086fd86c263652cd304cd272b559 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 19 May 2019 15:22:51 -0400 Subject: [PATCH] lang/markdown: fix doctor's executable detection --- modules/lang/markdown/doctor.el | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/lang/markdown/doctor.el b/modules/lang/markdown/doctor.el index 00167df56..cad8ccea4 100644 --- a/modules/lang/markdown/doctor.el +++ b/modules/lang/markdown/doctor.el @@ -6,6 +6,16 @@ (warn! "Couldn't find pandoc, markdown-mode may have issues"))) (when (require 'markdown-mode nil t) - (unless (executable-find markdown-command) - (warn! "Couldn't find %S, can't export markdown to html" - markdown-command))) + (cond ((eq markdown-command #'+markdown-compile) + (dolist (cmd (list (cons "marked" '+markdown-compile-marked) + (cons "pandoc" '+markdown-compile-pandoc) + (cons "markdown" '+markdown-compile-markdown))) + (when (and (memq (cdr cmd) +markdown-compile-functions) + (not (executable-find (car cmd)))) + (warn! "Couldn't find %S. markdown-preview command won't work" + (car cmd))))) + ((stringp markdown-command) + (let ((cmd (car (split-string markdown-command " ")))) + (unless (executable-find cmd) + (warn! "Couldn't find %S. markdown-preview command won't work" + cmd))))))