unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Simen Heggestøyl" <simenheg@gmail.com>
To: 30063@debbugs.gnu.org, stefan@merten-home.de
Subject: bug#30063: 26.0.90; Silent fail with `rst-compile-pdf-preview'
Date: Sat, 27 Jan 2018 12:59:55 +0100	[thread overview]
Message-ID: <1517054395.9954.0@smtp.gmail.com> (raw)
In-Reply-To: <87o9m14y0x.fsf@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 55 bytes --]

How about something like the attached patch?

-- Simen

[-- Attachment #1.2: Type: text/html, Size: 116 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Warn-about-missing-executables-in-RST-PDF-preview.patch --]
[-- Type: text/x-patch, Size: 1538 bytes --]

From 11bb53e567588539c92a520db321a5a9b746df58 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= <simenheg@gmail.com>
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


  reply	other threads:[~2018-01-27 11:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10 13:57 bug#30063: 26.0.90; Silent fail with `rst-compile-pdf-preview' Simen Heggestøyl
2018-01-27 11:59 ` Simen Heggestøyl [this message]
2018-01-28 18:11   ` Noam Postavsky
2018-01-29 17:43     ` Glenn Morris
2018-01-30 13:49     ` Eli Zaretskii
2018-01-30 14:30       ` Noam Postavsky
2018-01-30 15:40         ` Eli Zaretskii
2019-09-29 12:09   ` Lars Ingebrigtsen
2019-10-03 20:53     ` Stefan Merten
2019-10-07  3:25       ` Lars Ingebrigtsen
2019-10-09 16:13         ` Simen Heggestøyl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517054395.9954.0@smtp.gmail.com \
    --to=simenheg@gmail.com \
    --cc=30063@debbugs.gnu.org \
    --cc=stefan@merten-home.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).