GNU bug report logs -
#58774
29.0.50; [WISH]: Let us make EWW browse WWW Org files correctly
Previous Next
Reported by: Jean Louis <bugs <at> gnu.support>
Date: Tue, 25 Oct 2022 12:13:02 UTC
Severity: wishlist
Tags: wontfix
Found in version 29.0.50
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Jean Louis <bugs <at> gnu.support> writes:
>> This should be trivial to do, I think.
+1 and I say: consider contributing to EWW!
I noticed that the EWW manual says
PDFs are viewed inline, by default, with doc-view-mode, but this can
be customized by using the mailcap (see mailcap in Emacs MIME Manual)
mechanism, in particular mailcap-mime-data.
For some reason, it made me think that EWW uses MIME correctly.
So, I evaluated
(add-to-list 'mailcap-mime-data
(list "org"
(cons 'viewer 'org-mode)
(cons 'type "text/x-org")))
but it did not work. What the hack!
To satisfy my curiosity, I decided to look at the source code.
In eww.el, the eww-render procedure parses the content-type header and
stores its value in a local let binding. After that, it dispatches to
the various "display" procedures EWW comes with, such as
((equal (car content-type) "application/pdf")
(eww-display-pdf))
The eww-display-pdf procedure then looks up the MIME viewer for the
application/pdf MIME type specifically.
If no dispatch fits, EWW ends up calling eww-display-raw.
TL;DR EWW hard-codes a couple of MIME types.
You could improve the situation in various ways.
For example, you could
(1) patch EWW to expose the eww-content-type for the user to use, or
(2) patch EWW to look up MIME for not just the PDF.
You could hack something local to you as well, but a patch would make
EWW better for all of us. So, win-win!
Rudy
--
"Programming reliably -- must be an activity of an undeniably
mathematical nature […] You see, mathematics is about thinking, and
doing mathematics is always trying to think as well as possible."
-- Edsger W. Dijkstra, 1981
Rudolf Adamkovič <salutis <at> me.com> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia
This bug report was last modified 1 year and 259 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.