Subject: 29.0.50; [PATCH] Use mupdf in doc-view-mode if gs is not installed

From: Daniel Martín <[email-masked]>
Date: Mon, 29 Nov 2021 00:15:40 +0100

The Emacs manual says that mupdf (mudraw) can be used to render
PDF/PostScript documents in doc-view-mode.  However, I couldn't make it
work on a macOS system with only mupdf installed (no Ghostscript).

The fix seems to be simple, and with the attached patch I'm able to
render and browse PDFs correctly.  All doc-view features described in
the manual seem to work just fine.

If you think the patch is a good idea, please install it on my behalf.
Thanks.

>From 3a0fcc8a24923b997d6737082f0125de02778e9d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= <[email-masked]>
Date: Sun, 28 Nov 2021 23:59:05 +0100
Subject: [PATCH] Use mupdf in doc-view-mode if gs is not installed

* lisp/doc-view.el (doc-view-mode-p): Use mupdf to render PDF and
related formats if gs is not installed.
---
 lisp/doc-view.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 7e113e4f34..11559bf2f5 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -811,9 +811,10 @@ doc-view-mode-p
 		  (and doc-view-dvipdfm-program
 		       (executable-find doc-view-dvipdfm-program)))))
 	((memq type '(postscript ps eps pdf))
-	 ;; FIXME: allow mupdf here
-	 (and doc-view-ghostscript-program
-	      (executable-find doc-view-ghostscript-program)))
+	 (or (and doc-view-ghostscript-program
+	          (executable-find doc-view-ghostscript-program))
+             (and doc-view-pdfdraw-program
+                  (executable-find doc-view-pdfdraw-program))))
 	((eq type 'odf)
 	 (and doc-view-odf->pdf-converter-program
 	      (executable-find doc-view-odf->pdf-converter-program)
-- 
2.31.0