unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicholas Harrison <nicholasharrison222@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 44338@debbugs.gnu.org
Subject: bug#44338: 27.1; EWW can't download and view pdf
Date: Thu, 5 Nov 2020 08:18:19 -0700	[thread overview]
Message-ID: <CAGdSj9G+MNP1N2vTkEZhpKfN-B_F3J0RQQ+9tuZ0Y8X5HXTzkw@mail.gmail.com> (raw)
In-Reply-To: <837dqzc42r.fsf@gnu.org>

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

After running the code you gave and using eww to open a pdf, this is what I
get:

Debugger entered--entering a function:
* select-safe-coding-system("100" nil prefer-utf-8 nil
"c:/Users/nicho/AppData/Local/Temp/docview1001/!eww
pdf!-2072e1249b26ee28e656f1a01f0cb4a9/resolution.el")
  write-region("100" nil
"c:/Users/nicho/AppData/Local/Temp/docview1001/!eww
pdf!-2072e1249b26ee28e656f1a01f0cb4a9/resolution.el" nil silently)
  #f(compiled-function () #<bytecode 0x1ff19f1>)()
  doc-view-sentinel(#<process pdf/ps->png> "finished\n")

Debugger entered--returning value: prefer-utf-8-dos
  select-safe-coding-system("100" nil prefer-utf-8 nil
"c:/Users/nicho/AppData/Local/Temp/docview1001/!eww
pdf!-2072e1249b26ee28e656f1a01f0cb4a9/resolution.el")
  write-region("100" nil
"c:/Users/nicho/AppData/Local/Temp/docview1001/!eww
pdf!-2072e1249b26ee28e656f1a01f0cb4a9/resolution.el" nil silently)
  #f(compiled-function () #<bytecode 0x1ff19f1>)()
  doc-view-sentinel(#<process pdf/ps->png> "finished\n")

The buffer it ends up with says:
Cannot display this page!
Maybe because of a conversion failure!

On Thu, Nov 5, 2020 at 6:42 AM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Nicholas Harrison <nicholasharrison222@gmail.com>
> > Date: Wed, 4 Nov 2020 16:43:13 -0700
> > Cc: "Basil L. Contovounesios" <contovob@tcd.ie>, 44338@debbugs.gnu.org
> >
> > Not sure if this is much help, but here is the backtrace given when I do
> the following steps:
> >
> > 1. emacs -Q
> > 2. M-: (debug-on-entry 'select-safe-coding-system) RET
> > 3. M-x eww RET
> https://www.gnu.org/software/emacs/manual/pdf/emacs-xtra.pdf RET
> > (no backtrace here)
> > 4. M-x doc-view-mode RET
> >
> > Debugger entered--entering a function:
> > * select-safe-coding-system(1 381654 iso-latin-1-dos nil
> > "c:/Users/nicho/AppData/Local/Temp/docview1001/!eww pdf!")
> >   write-region(nil nil
> "c:/Users/nicho/AppData/Local/Temp/docview1001/!eww pdf!")
> >   doc-view-mode()
> >   funcall-interactively(doc-view-mode)
> >   call-interactively(doc-view-mode record nil)
> >   command-execute(doc-view-mode record)
> >   execute-extended-command(nil "doc-view-mode" "doc-view-mo")
> >   funcall-interactively(execute-extended-command nil "doc-view-mode"
> "doc-view-mo")
> >   call-interactively(execute-extended-command nil nil)
> >   command-execute(execute-extended-command)
>
> Thanks.  This tells part of the story, but not all of it.  What I
> wanted to see was the backtrace when doc-view-mode is invoked by EWW.
> AFAIU, that requires you to augment mailcap-user-mime-data as this:
>
>  (add-to-list 'mailcap-user-mime-data
>               '((type . "application/pdf")
>                 (viewer . doc-view-mode)))
>
> before performing the reproduction steps.
>
> To give you more background: when you invoke doc-view-mode manually in
> a buffer produced by "M-x eww", the buffer's buffer-file-coding-system
> is the platform default, in your case iso-latin-1-dos.  That is what
> doc-view-mode uses to write the PDF bytestream to a temporary file,
> and that fails because iso-latin-1-dos cannot encode the raw bytes in
> the binary content.  But eww-display-pdf binds coding-system-for-write
> to 'raw-text, and then doc-view-mode ought to use that to write to the
> temporary file, and yet in your screenshot I still see it tried to use
> iso-latin-1-dos, which I cannot explain.  So I'd like to see the
> backtrace when you invoke doc-view-mode via EWW, after augmenting
> mailcap-user-mime-data, to try to understand why it uses the wrong
> encoding.
>
> Can you please produce the backtrace under those  modified conditions?
>

[-- Attachment #2: Type: text/html, Size: 4814 bytes --]

  reply	other threads:[~2020-11-05 15:18 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 22:20 bug#44338: 27.1; EWW can't download and view pdf Nicholas Harrison
2020-10-31 13:43 ` Basil L. Contovounesios
2020-10-31 16:35   ` Jean Louis
2020-10-31 17:14     ` Nicholas Harrison
2020-10-31 23:16       ` Nicholas Harrison
2020-11-01 14:56         ` Basil L. Contovounesios
2020-11-03 23:24     ` Basil L. Contovounesios
2020-11-05 15:13       ` Lars Ingebrigtsen
2020-11-05 17:37         ` Basil L. Contovounesios
2020-11-01 14:20   ` Lars Ingebrigtsen
2020-11-01 14:59     ` Basil L. Contovounesios
2020-11-02 14:59       ` Lars Ingebrigtsen
2020-11-02 16:50         ` Basil L. Contovounesios
2020-11-03 14:49           ` Lars Ingebrigtsen
2020-11-03 21:28             ` Basil L. Contovounesios
2020-11-05 15:12               ` Lars Ingebrigtsen
2020-11-05 17:36                 ` Basil L. Contovounesios
2020-11-05 20:40                 ` Basil L. Contovounesios
2020-11-03 23:52   ` Nicholas Harrison
2020-11-04  0:23     ` Basil L. Contovounesios
2020-11-04  1:01       ` Nicholas Harrison
2020-11-04 15:10       ` Eli Zaretskii
2020-11-04  0:25     ` Basil L. Contovounesios
2020-11-04 15:07     ` Eli Zaretskii
2020-11-04 20:01       ` Basil L. Contovounesios
2020-11-04 23:43       ` Nicholas Harrison
2020-11-05 13:42         ` Eli Zaretskii
2020-11-05 13:42         ` Eli Zaretskii
2020-11-05 15:18           ` Nicholas Harrison [this message]
2020-11-05 15:49             ` Eli Zaretskii
2020-11-05 17:52               ` Nicholas Harrison
2020-11-05 17:55                 ` Eli Zaretskii
2020-11-05 19:04                   ` Basil L. Contovounesios
2020-11-05 19:20                     ` Eli Zaretskii
2020-11-05 21:17                       ` Basil L. Contovounesios
2020-11-06  5:29                         ` Eli Zaretskii
2020-11-05 20:40                     ` Lars Ingebrigtsen
2020-11-05 21:25                       ` Basil L. Contovounesios
2020-11-06  2:12                         ` Nicholas Harrison

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=CAGdSj9G+MNP1N2vTkEZhpKfN-B_F3J0RQQ+9tuZ0Y8X5HXTzkw@mail.gmail.com \
    --to=nicholasharrison222@gmail.com \
    --cc=44338@debbugs.gnu.org \
    --cc=eliz@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 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).