Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Display attached pdf's with external view, not with doc-view-mode
@ 2016-04-01 15:14 Teemu Likonen
  2016-04-01 16:38 ` Charles Philip Chan
  0 siblings, 1 reply; 3+ messages in thread
From: Teemu Likonen @ 2016-04-01 15:14 UTC (permalink / raw)
  To: info-gnus-english


[-- Attachment #1.1: Type: text/plain, Size: 532 bytes --]

I've been using Emacs 25.0.92 for a while and noticed that Gnus has
started to display attached pdf files with doc-view-mode (inside Emacs)
instead of launching an external viewer. In mailcap-mime-data variable I
have external viewer (Okular) first for the application/pdf MIME type
but Gnus doesn't want to respect that.

How do configure Gnus to use external viewer for attached pdf files?

-- 
/// Teemu Likonen   - .-..   <https://github.com/tlikonen> //
// PGP: 4E10 55DC 84E9 DFF6 13D7 8557 719D 69D3 2453 9450 ///

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Display attached pdf's with external view, not with doc-view-mode
  2016-04-01 15:14 Display attached pdf's with external view, not with doc-view-mode Teemu Likonen
@ 2016-04-01 16:38 ` Charles Philip Chan
  2016-04-01 17:33   ` Teemu Likonen
  0 siblings, 1 reply; 3+ messages in thread
From: Charles Philip Chan @ 2016-04-01 16:38 UTC (permalink / raw)
  To: info-gnus-english


[-- Attachment #1.1: Type: text/plain, Size: 1046 bytes --]

Teemu Likonen <tlikonen@iki.fi> writes:

> I've been using Emacs 25.0.92 for a while and noticed that Gnus has
> started to display attached pdf files with doc-view-mode (inside Emacs)
> instead of launching an external viewer. In mailcap-mime-data variable I
> have external viewer (Okular) first for the application/pdf MIME type
> but Gnus doesn't want to respect that.

This is not a Gnus problem, but Emacs have changed to default to
docview-mode for pdf files, ignoring mailcap.

> How do configure Gnus to use external viewer for attached pdf files?

;;Remove doc-view so pdf will open with ocular
(setcdr
   (assoc "application" mailcap-mime-data)
   (remove '("pdf"
             (viewer . doc-view-mode)
             (type . "application/pdf")
             (test eq window-system 'x))
           (cdr (assoc "application" mailcap-mime-data))))

Charles

-- 
"If you want to travel around the world and be invited to speak at a lot
of different places, just write a Unix operating system."
(By Linus Torvalds)

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 180 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Display attached pdf's with external view, not with doc-view-mode
  2016-04-01 16:38 ` Charles Philip Chan
@ 2016-04-01 17:33   ` Teemu Likonen
  0 siblings, 0 replies; 3+ messages in thread
From: Teemu Likonen @ 2016-04-01 17:33 UTC (permalink / raw)
  To: Charles Philip Chan; +Cc: info-gnus-english


[-- Attachment #1.1: Type: text/plain, Size: 1038 bytes --]

Charles Philip Chan [2016-04-01 12:38:27-04] wrote:

> This is not a Gnus problem, but Emacs have changed to default to
> docview-mode for pdf files, ignoring mailcap.

Thanks. I hope there's a nice way to completely ignore *-view-mode. I
wrote this but it is quite brutal approach:

(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 #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-01 17:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-01 15:14 Display attached pdf's with external view, not with doc-view-mode Teemu Likonen
2016-04-01 16:38 ` Charles Philip Chan
2016-04-01 17:33   ` 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 NNTP newsgroup(s).