From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.bugs Subject: bug#24042: mudraw doesn't exist any more Date: Wed, 20 Jul 2016 21:55:17 -0400 Message-ID: <87shv3ycu2.fsf@udel.edu> References: <87vazz9b11.fsf@petton.fr> <87zipb3hdb.fsf@udel.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1469066187 3008 80.91.229.3 (21 Jul 2016 01:56:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jul 2016 01:56:27 +0000 (UTC) Cc: Nicolas Petton , 24042@debbugs.gnu.org, Tassilo Horn To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 21 03:56:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bQ3Dj-00089Z-Mp for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Jul 2016 03:56:15 +0200 Original-Received: from localhost ([::1]:37843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQ3Di-0003dJ-G5 for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Jul 2016 21:56:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQ3Db-0003d1-Vc for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 21:56:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQ3DW-0005Uu-VD for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 21:56:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQ3DW-0005Uq-Rc for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 21:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bQ3DW-0005gz-HU for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 21:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Jul 2016 01:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24042 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24042-submit@debbugs.gnu.org id=B24042.146906612621837 (code B ref 24042); Thu, 21 Jul 2016 01:56:02 +0000 Original-Received: (at 24042) by debbugs.gnu.org; 21 Jul 2016 01:55:26 +0000 Original-Received: from localhost ([127.0.0.1]:59133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ3Cw-0005g9-D2 for submit@debbugs.gnu.org; Wed, 20 Jul 2016 21:55:26 -0400 Original-Received: from mail-qk0-f193.google.com ([209.85.220.193]:34461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQ3Cu-0005fw-RP for 24042@debbugs.gnu.org; Wed, 20 Jul 2016 21:55:25 -0400 Original-Received: by mail-qk0-f193.google.com with SMTP id p126so5367496qke.1 for <24042@debbugs.gnu.org>; Wed, 20 Jul 2016 18:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=4oIMSptmyz66Db1g4D1ysO9Vlk7itiRvsEjf4MtW+qg=; b=pgzz3J6n+hI0TCU6dvR0mpNixPP9nGF9jaoOBZJQUx66qYLGeW94l9usrMw01kvzcx MKVzBVR2GQE4XAkMJ5LocDumdV8KY/GkdTwujkfsTQ/48Xhr8kTHguPlD11LaC1D/rYw dEB/XHQLzbOsg1WbVXTk9w6xotoAaHJj9GizB50yvFZGPlMj+lsxKy++70ppEO1VAT48 Bvm5ykmCOoVrPu8u/4Wys5zy8JMSow4a7vnm9xqTcUQtFZmuA6HqO+E1tf7gpO1787SD 1VebKalbRqxUIKtePWGE0AEZIuJktyWMPn2tiig/+068BQteHK5WDxHZBgDb9HHFVkG+ nlFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=4oIMSptmyz66Db1g4D1ysO9Vlk7itiRvsEjf4MtW+qg=; b=mWUp+6WTsv5jPnz92zFw/GflW1Sg/T6ziQranUCxDA9ui5kZTn0kSVrZHV+fOLyOx3 1CoTu/eEHcsjjXO/9YGpdgPKg4nOr96Tbj96X6+5hi2BPr7msnMnYr91eCAM4fDjAwEX nqA2/Vcz1SwqmdMUhpXFobYgCkNZ4QmZsWP1hNwE2rTTlEEZg3wz91XJxbUVCg8x+5oq lxeNTf2m5hHb82Krwf84JvIF/RMxwo1J2MQNCcE3mz7xvS2J0g2PF1KHYotOjtCW6DG8 lry/2LX1tqIBrIQLiu34u23mUSJBBCR9K4dOUaWfnJWDvTxGsvfbbPf66SKGXDHrt80h V6ng== X-Gm-Message-State: ALyK8tIrR4xwbNM4vz+Nv0Zk362J5y3DSxuz0quBlQYtegC+YTME/tmcfbXJ5+lYCZQlINa0 X-Received: by 10.55.201.136 with SMTP id m8mr15772387qkl.166.1469066119217; Wed, 20 Jul 2016 18:55:19 -0700 (PDT) Original-Received: from holos.localdomain (ip68-100-200-121.dc.dc.cox.net. [68.100.200.121]) by smtp.gmail.com with ESMTPSA id d190sm3073123qke.18.2016.07.20.18.55.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jul 2016 18:55:18 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id 9884D66C35; Wed, 20 Jul 2016 21:55:17 -0400 (EDT) In-Reply-To: <87zipb3hdb.fsf@udel.edu> (Mark Oteiza's message of "Wed, 20 Jul 2016 21:33:04 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121352 Archived-At: Mark Oteiza writes: > Stefan Monnier 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))))