]> git.eshelyaron.com Git - emacs.git/commitdiff
Warn about missing executables in RST PDF preview
authorSimen Heggestøyl <simenheg@gmail.com>
Sat, 27 Jan 2018 11:18:40 +0000 (12:18 +0100)
committerSimen Heggestøyl <simenheg@gmail.com>
Wed, 9 Oct 2019 16:12:02 +0000 (18:12 +0200)
* lisp/textmodes/rst.el (rst-compile-pdf-preview): Warn about missing
executables when attempting to compile and preview an RST file as PDF.
(Bug#30063)

lisp/textmodes/rst.el

index b7438fbb109fe256de32010bd19b014516967435..ce9e6335117886a44c0115d7c1ca04ce2fd30e02 100644 (file)
@@ -4380,10 +4380,15 @@ buffer, if the region is not selected."
   "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.