From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: How to NOT use doc-view-mode as mime viewer? Date: Fri, 01 Apr 2016 20:39:36 +0200 Message-ID: <87mvpdqil3.fsf@web.de> References: <871t6pgrd5.fsf@iki.fi> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1459536021 12189 80.91.229.3 (1 Apr 2016 18:40:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Apr 2016 18:40:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 01 20:40:13 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1am3zQ-0008If-DZ for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Apr 2016 20:40:12 +0200 Original-Received: from localhost ([::1]:45868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1am3zP-0005jK-Ty for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Apr 2016 14:40:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1am3zF-0005jA-In for help-gnu-emacs@gnu.org; Fri, 01 Apr 2016 14:40:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1am3zB-0007Vl-Lh for help-gnu-emacs@gnu.org; Fri, 01 Apr 2016 14:40:01 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:42487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1am3zB-0007Ve-FK for help-gnu-emacs@gnu.org; Fri, 01 Apr 2016 14:39:57 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1am3z8-00089B-G4 for help-gnu-emacs@gnu.org; Fri, 01 Apr 2016 20:39:54 +0200 Original-Received: from dslb-088-067-099-237.088.067.pools.vodafone-ip.de ([88.67.99.237]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Apr 2016 20:39:54 +0200 Original-Received: from michael_heerdegen by dslb-088-067-099-237.088.067.pools.vodafone-ip.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Apr 2016 20:39:54 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslb-088-067-099-237.088.067.pools.vodafone-ip.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:l0jtbEPS5cS8DxXAicBoRPXUQ1c= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109702 Archived-At: Teemu Likonen 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.