>From 11bb53e567588539c92a520db321a5a9b746df58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= Date: Sat, 27 Jan 2018 12:18:40 +0100 Subject: [PATCH] Warn about missing executables in RST PDF preview * lisp/textmodes/rst.el (rst-compile-pdf-preview): Warn about missing executables when attempting to compile and preview an RST file as PDF. (Bug#30218) --- lisp/textmodes/rst.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index c93e4e474c..a16d5bca3a 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -4382,10 +4382,15 @@ rst-compile-pdf-preview "Convert the document to a PDF file and launch a preview program." (interactive) (let* ((tmp-filename (make-temp-file "rst_el" nil ".pdf")) + (pdf-compile-program (cadr (assq 'pdf rst-compile-toolsets))) (command (format "%s %s %s && %s %s ; rm %s" - (cadr (assq 'pdf rst-compile-toolsets)) + pdf-compile-program buffer-file-name tmp-filename rst-pdf-program tmp-filename tmp-filename))) + (unless (executable-find pdf-compile-program) + (error "Cannot find executable `%s'" pdf-compile-program)) + (unless (executable-find rst-pdf-program) + (error "Cannot find executable `%s'" rst-pdf-program)) (start-process-shell-command "rst-pdf-preview" nil command) ;; Note: you could also use (compile command) to view the compilation ;; output. -- 2.15.1