all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark Oteiza <mvoteiza@udel.edu>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Nicolas Petton <nicolas@petton.fr>,
	24042@debbugs.gnu.org, Tassilo Horn <tsdh@gnu.org>
Subject: bug#24042: mudraw doesn't exist any more
Date: Wed, 20 Jul 2016 21:55:17 -0400	[thread overview]
Message-ID: <87shv3ycu2.fsf@udel.edu> (raw)
In-Reply-To: <87zipb3hdb.fsf@udel.edu> (Mark Oteiza's message of "Wed, 20 Jul 2016 21:33:04 -0400")

Mark Oteiza <mvoteiza@udel.edu> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>>> Apparently mudraw has been superseded by "mutool draw".  I'm using the
>>>> patch below to accommodate this new situation, but it's not
>>>> quite satisfactory.
>>> Why is it not satisfactory?  What choice do we have if `mudraw' has been
>>> replaced?
>>
>> It's the string-match that's not very satisfactory.  If the "mutool"
>> happens to have a name that doesn't match the regexp, or if some other
>> tool (pdfdraw or mudraw) happens to match the regexp things will go wrong.
>
> There should likely be a doc-view-pdfdraw-options.  I remember poking
> net-utils.el recently which has an approach like this.  May not solve
> the problem, but at least it is exposed to the user.

diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 223565c..e52b078 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -161,10 +161,20 @@ doc-view-ghostscript-program
 (defcustom doc-view-pdfdraw-program
   (cond
    ((executable-find "pdfdraw") "pdfdraw")
+   ((executable-find "mudraw") "mudraw")
+   ((executable-find "mutool") "mutool")
    (t "mudraw"))
   "Name of MuPDF's program to convert PDF files to PNG."
   :type 'file
-  :version "24.4")
+  :version "25.1")
+
+(defcustom doc-view-pdfdraw-options
+  (cond
+   ((string-match-p "mutool\\'" doc-view-pdfdraw-program) (list "draw"))
+   (t nil))
+  "A list of options to give to `doc-view-pdfdraw-program'."
+  :type '(repeat string)
+  :version "25.1")
 
 (defcustom doc-view-pdf->png-converter-function
   (if (executable-find doc-view-pdfdraw-program)
@@ -960,7 +970,8 @@ doc-view-djvu->tiff-converter-ddjvu
 (defun doc-view-pdf->png-converter-mupdf (pdf png page callback)
   (doc-view-start-process
    "pdf->png" doc-view-pdfdraw-program
-   `(,(concat "-o" png)
+   `(,@doc-view-pdfdraw-options
+     ,(concat "-o" png)
      ,(format "-r%d" (round doc-view-resolution))
      ,pdf
      ,@(if page `(,(format "%d" page))))





  reply	other threads:[~2016-07-21  1:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 21:24 bug#24042: mudraw doesn't exist any more Stefan Monnier
2016-07-20 22:53 ` Nicolas Petton
2016-07-21  1:17   ` Stefan Monnier
2016-07-21  1:33     ` Mark Oteiza
2016-07-21  1:55       ` Mark Oteiza [this message]
2016-07-21  3:46         ` Clément Pit--Claudel
2020-09-04 13:16 ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=87shv3ycu2.fsf@udel.edu \
    --to=mvoteiza@udel.edu \
    --cc=24042@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=nicolas@petton.fr \
    --cc=tsdh@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.