diff options
| author | Simen Heggestøyl | 2018-01-27 12:18:40 +0100 |
|---|---|---|
| committer | Simen Heggestøyl | 2019-10-09 18:12:02 +0200 |
| commit | 3d57c829af571465c261d9f865eeee5ed3cae985 (patch) | |
| tree | caf4ea09bd998fe48b70d0b243dec543fddadc7c | |
| parent | 697a7a1497d053d6070432d3a48824e01082ca42 (diff) | |
| download | emacs-3d57c829af571465c261d9f865eeee5ed3cae985.tar.gz emacs-3d57c829af571465c261d9f865eeee5ed3cae985.zip | |
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#30063)
| -rw-r--r-- | lisp/textmodes/rst.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index b7438fbb109..ce9e6335117 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el | |||
| @@ -4380,10 +4380,15 @@ buffer, if the region is not selected." | |||
| 4380 | "Convert the document to a PDF file and launch a preview program." | 4380 | "Convert the document to a PDF file and launch a preview program." |
| 4381 | (interactive) | 4381 | (interactive) |
| 4382 | (let* ((tmp-filename (make-temp-file "rst_el" nil ".pdf")) | 4382 | (let* ((tmp-filename (make-temp-file "rst_el" nil ".pdf")) |
| 4383 | (pdf-compile-program (cadr (assq 'pdf rst-compile-toolsets))) | ||
| 4383 | (command (format "%s %s %s && %s %s ; rm %s" | 4384 | (command (format "%s %s %s && %s %s ; rm %s" |
| 4384 | (cadr (assq 'pdf rst-compile-toolsets)) | 4385 | pdf-compile-program |
| 4385 | buffer-file-name tmp-filename | 4386 | buffer-file-name tmp-filename |
| 4386 | rst-pdf-program tmp-filename tmp-filename))) | 4387 | rst-pdf-program tmp-filename tmp-filename))) |
| 4388 | (unless (executable-find pdf-compile-program) | ||
| 4389 | (error "Cannot find executable `%s'" pdf-compile-program)) | ||
| 4390 | (unless (executable-find rst-pdf-program) | ||
| 4391 | (error "Cannot find executable `%s'" rst-pdf-program)) | ||
| 4387 | (start-process-shell-command "rst-pdf-preview" nil command) | 4392 | (start-process-shell-command "rst-pdf-preview" nil command) |
| 4388 | ;; Note: you could also use (compile command) to view the compilation | 4393 | ;; Note: you could also use (compile command) to view the compilation |
| 4389 | ;; output. | 4394 | ;; output. |