* How to NOT use doc-view-mode as mime viewer?
@ 2016-04-01 17:40 Teemu Likonen
2016-04-01 18:39 ` Michael Heerdegen
0 siblings, 1 reply; 3+ messages in thread
From: Teemu Likonen @ 2016-04-01 17:40 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]
It seems that Emacs 25 prefers doc-view-mode for displaying various
contents such as application/pdf mime types. I'd prefer external viewers
as defined elsewhere in my system (mailcap). I can brutally delete every
reference to doc-view-mode from mailcap-mime-data variable (see the code
below) but I'd prefer taking a less brutal route. Any ideas?
(require 'cl-lib)
(require 'mailcap)
(setq mailcap-mime-data
(mapcar (lambda (major)
(cons (car major)
(cl-remove-if
(lambda (minor)
(cl-member-if
(lambda (v)
(cl-member v '(doc-view-mode
pdf-view-mode
view-mode)))
(cdr minor)
:key 'cdr))
(cdr major))))
mailcap-mime-data))
--
/// Teemu Likonen - .-.. <https://github.com/tlikonen> //
// PGP: 4E10 55DC 84E9 DFF6 13D7 8557 719D 69D3 2453 9450 ///
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to NOT use doc-view-mode as mime viewer?
2016-04-01 17:40 How to NOT use doc-view-mode as mime viewer? Teemu Likonen
@ 2016-04-01 18:39 ` Michael Heerdegen
2016-04-02 7:56 ` Teemu Likonen
0 siblings, 1 reply; 3+ messages in thread
From: Michael Heerdegen @ 2016-04-01 18:39 UTC (permalink / raw)
To: help-gnu-emacs
Teemu Likonen <tlikonen@iki.fi> writes:
> It seems that Emacs 25 prefers doc-view-mode for displaying various
> contents such as application/pdf mime types. I'd prefer external
> viewers as defined elsewhere in my system (mailcap). I can brutally
> delete every reference to doc-view-mode from mailcap-mime-data
> variable (see the code below) but I'd prefer taking a less brutal
> route. Any ideas?
I wonder that, too.
I came to the same conclusion - this is the hack I use:
#+begin_src emacs-lisp
(with-eval-after-load 'mailcap
(let* ((apps (cdr (assoc "application" mailcap-mime-data)))
(to-delete (seq-some (lambda (el) (and (equal (nth 0 el) "pdf")
(equal (nth 1 el) '(viewer . doc-view-mode))
el))
apps)))
(setq mailcap-mime-data (cons (cons "application" (delq to-delete apps))
(delq apps mailcap-mime-data)))))
#+end_src
Michael.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-02 7:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-01 17:40 How to NOT use doc-view-mode as mime viewer? Teemu Likonen
2016-04-01 18:39 ` Michael Heerdegen
2016-04-02 7:56 ` Teemu Likonen
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).