GNU bug report logs - #44338
27.1; EWW can't download and view pdf

Previous Next

Package: emacs;

Reported by: Nicholas Harrison <nicholasharrison222 <at> gmail.com>

Date: Fri, 30 Oct 2020 22:21:02 UTC

Severity: minor

Tags: fixed, patch

Found in version 27.1

Fixed in version 28.1

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


Message #96 received at 44338 <at> debbugs.gnu.org (full text, mbox):

From: Nicholas Harrison <nicholasharrison222 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 44338 <at> debbugs.gnu.org
Subject: Re: bug#44338: 27.1; EWW can't download and view pdf
Date: Thu, 5 Nov 2020 10:52:10 -0700
[Message part 1 (text/plain, inline)]
No, it didn't ask me for an encoding.

Good stab in the dark. I ran your new function code and the
mailcap-user-mime-data code again (after loading eww). No debugger
triggered. It converted and showed the pdf correctly.

On Thu, Nov 5, 2020 at 8:50 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Nicholas Harrison <nicholasharrison222 <at> gmail.com>
> > Date: Thu, 5 Nov 2020 08:18:19 -0700
> > Cc: 44338 <at> debbugs.gnu.org
> >
> > 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")
>
> Hmm, that's not the problem you reported originally, and it doesn't
> look like Emacs asked you to select an encoding here, did it?
>
> > The buffer it ends up with says:
> > Cannot display this page!
> > Maybe because of a conversion failure!
>
> So I guess I'm confused now and don't know what is the problem, sorry.
>
> A stub in the dark: if you replace raw-text with raw-text-unix here:
>
>   (defun eww-display-pdf ()
>     (let ((data (buffer-substring (point) (point-max))))
>       (pop-to-buffer-same-window (get-buffer-create "*eww pdf*"))
>       (let ((coding-system-for-write 'raw-text)  <<<<<<<<<<<<<<<<<<<
>             (inhibit-read-only t))
>         (erase-buffer)
>         (insert data)
>         (mailcap-view-mime "application/pdf")))
>     (goto-char (point-min)))
>
> does the problem go away?
>
[Message part 2 (text/html, inline)]

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

Previous Next


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