unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Federico Tedin <federicotedin@gmail.com>
Cc: 33684@debbugs.gnu.org, jidanni@jidanni.org
Subject: bug#33684: DocView bombs out upon password protected PDFs
Date: Sun, 03 Feb 2019 09:40:08 +0100	[thread overview]
Message-ID: <87lg2x5kpj.fsf@gnu.org> (raw)
In-Reply-To: <875zu1x607.fsf@gmail.com> (Federico Tedin's message of "Sat, 02 Feb 2019 17:58:00 -0300")

Federico Tedin <federicotedin@gmail.com> writes:

Hi Federico,

> Here's the new version of the patch, which enables using MuPDF to open
> password-protected PDF files.
>
> One problem I encountered while writing it is that function
> `doc-view-pdf->png-converter-mupdf' uses a small hack to add "draw" to
> the arguments list passed to `doc-view-start-process', only when
> `doc-view-pdfdraw-program' has the value "mutool". This is because the
> "mudraw" command has been replaced at some point by the "mutool"
> command, which requires passing "draw" as a subcommand to do the same
> work. I ended up using the same hack in the new function I created,
> with a reference to the original one, but I'm not sure this was the
> best possible approach. Is there a cleaner way to solve this?

You could have extracted that into its own function, e.g.,

(defun doc-view-pdfdraw-program-subcommand ()
  "Return the mutool subcommand replacing mudraw.

Recent mupdf distribution replaced mudraw with `mutool draw'."
  (when (string-match "mutool[^/\\]*$" doc-view-pdfdraw-program)
    '("draw")))

and use that at those two places.

Could you please commit the patch locally (including the ChangeLog style
commit message) and send it exported with "git format-patch"?

Bye,
Tassilo

PS: I had acually also accepted using the ghostscript password check
with mupdf, too.  But since you don't need ghostscript for PDFs if you
have mupdf, your approach is even better.






  reply	other threads:[~2019-02-03  8:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-09 10:52 bug#33684: DocView bombs out upon password protected PDFs 積丹尼 Dan Jacobson
2019-01-27  2:14 ` Federico Tedin
2019-02-01  9:33   ` Eli Zaretskii
2019-02-01 10:12     ` Tassilo Horn
2019-02-01 10:34       ` Eli Zaretskii
2019-02-01 10:42         ` Federico Tedin
2019-02-02 20:58         ` Federico Tedin
2019-02-03  8:40           ` Tassilo Horn [this message]
2019-02-03 16:55             ` Federico Tedin
2019-02-04  5:44               ` Tassilo Horn
2019-02-04  6:29                 ` Eli Zaretskii
2019-02-04  6:52                   ` Tassilo Horn
2019-02-04 15:49                   ` Tassilo Horn
2019-02-04 21:24                     ` Federico Tedin

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87lg2x5kpj.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=33684@debbugs.gnu.org \
    --cc=federicotedin@gmail.com \
    --cc=jidanni@jidanni.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 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).