From: "Björn Bidar" <bjorn.bidar@thaodan.de>
To: Andrew Cohen <acohen@ust.hk>
Cc: ding@gnus.org
Subject: Re: View docx/doc documents from Gnus in Docview
Date: Mon, 11 Sep 2023 22:01:50 +0300 [thread overview]
Message-ID: <871qf4y1nl.fsf@thaodan.de> (raw)
In-Reply-To: <87pm2p5sjc.fsf@ust.hk> (Andrew Cohen's message of "Mon, 11 Sep 2023 10:53:59 +0800")
Andrew Cohen <acohen@ust.hk> writes:
> Sorry for not replying sooner (I am swamped with real work and have
> little time for other things); I have had this working for myself so I
> thought I can provide some advice.
>
> Firstly, telling gnus to use doc-view for these documents is easy: you
> need to modify the variable 'mailcap-user-mime-data (which controls user
> overrides for various mime types). Here is an example (this will use
> doc-view-mode for mime types of ms-excel and
> openxmlformats-officedocument.wordprocessingml.document, and use eww for
> html.) You should modify this for your own needs:
>
> (setq mailcap-user-mime-data
> '(((viewer . doc-view-mode)
> (test . window-system)
> (type . "application/vnd.ms-excel"))
> ((viewer . doc-view-mode)
> (test . window-system)
> (type . "application/vnd.openxmlformats-officedocument.wordprocessingml.document"))
> ((viewer . eww)
> (test . (fboundp 'eww))
> (type . "text/html"))))
>
> But unfortunately this won't work properly due to a deficiency in
> doc-view. Doc-view has only a fairly primitive mechanism for figuring
> out the type of the document; since docx documents are mostly zip
> archives, and many other file formats are also zip archives, doc-view
> will notice they are zip files and treat them as epub (for me, at
> least). The right way to fix this is to smarten up doc-view to
> correctly identify the file type. This isn't hard, but I don't have time
> to do it right now (maybe someone else is willing?). In the meantime
> you can use the following hack which works for me: replace the function
> 'doc-view-set-doc-type with the modified version below.
Thanks that's exactly what I was looking for. I assumed since docview
can detect docx in dired in can do so in Gnus.
Docview is just ok, I would prefer something like pdf-tools for docx/odt
but I see those kind of file types so rare.
prev parent reply other threads:[~2023-09-12 16:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 16:18 Björn Bidar
2023-09-10 16:20 ` Eric Abrahamsen
2023-09-10 19:50 ` Björn Bidar
2023-09-10 21:43 ` Eric Abrahamsen
2023-09-11 2:53 ` Andrew Cohen
2023-09-11 17:01 ` Eric Abrahamsen
2023-09-12 0:37 ` Andrew Cohen
2023-09-12 17:59 ` Eric Abrahamsen
2023-09-11 19:01 ` Björn Bidar [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871qf4y1nl.fsf@thaodan.de \
--to=bjorn.bidar@thaodan.de \
--cc=acohen@ust.hk \
--cc=ding@gnus.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.
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 NNTP newsgroup(s).