unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52170: 29.0.50; [PATCH] Use mupdf in doc-view-mode if gs is not installed
       [not found] <m18rx7dg83.fsf.ref@yahoo.es>
@ 2021-11-28 23:15 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-11-29 14:48   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-28 23:15 UTC (permalink / raw)
  To: 52170

[-- Attachment #1: Type: text/plain, Size: 459 bytes --]


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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-mupdf-in-doc-view-mode-if-gs-is-not-installed.patch --]
[-- Type: text/x-patch, Size: 1197 bytes --]

From 3a0fcc8a24923b997d6737082f0125de02778e9d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= <mardani29@yahoo.es>
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#52170: 29.0.50; [PATCH] Use mupdf in doc-view-mode if gs is not installed
  2021-11-28 23:15 ` bug#52170: 29.0.50; [PATCH] Use mupdf in doc-view-mode if gs is not installed Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-11-29 14:48   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-29 14:48 UTC (permalink / raw)
  To: Daniel Martín; +Cc: 52170

Daniel Martín <mardani29@yahoo.es> writes:

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

Looks good to me; pushed to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-29 14:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m18rx7dg83.fsf.ref@yahoo.es>
2021-11-28 23:15 ` bug#52170: 29.0.50; [PATCH] Use mupdf in doc-view-mode if gs is not installed Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-29 14:48   ` Lars Ingebrigtsen

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).