GNU bug report logs - #24042
mudraw doesn't exist any more

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Wed, 20 Jul 2016 21:23:02 UTC

Severity: normal

Found in version 25.1.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Clément Pit--Claudel <clement.pit <at> gmail.com>
To: 24042 <at> debbugs.gnu.org
Subject: bug#24042: mudraw doesn't exist any more
Date: Wed, 20 Jul 2016 23:46:56 -0400
[Message part 1 (text/plain, inline)]
Alternatively, we could change from a program name to a function that builds a command line string; this would work with viewer/renderers that don't accept -o and -r.

On 2016-07-20 21:55, Mark Oteiza wrote:
> Mark Oteiza <mvoteiza <at> udel.edu> writes:
> 
>> Stefan Monnier <monnier <at> 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))))
> 
> 
> 
> 

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 4 years and 258 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.