From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: gmane.emacs.help Subject: Re: pdf viewer Date: Sun, 07 Oct 2018 01:12:38 +0100 Organization: A noiseless patient Spider Message-ID: <871s92iphl.fsf@bsb.me.uk> References: <87k1mv78ht.fsf@alfa.kjonca> <87woqvjtxg.fsf@iki.fi> <87va6fjpj3.fsf@alfa.kjonca> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1538871211 17932 195.159.176.226 (7 Oct 2018 00:13:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 7 Oct 2018 00:13:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 07 02:13:26 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g8whH-0004SA-N9 for geh-help-gnu-emacs@m.gmane.org; Sun, 07 Oct 2018 02:13:23 +0200 Original-Received: from localhost ([::1]:40712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8wjN-0008Kz-R6 for geh-help-gnu-emacs@m.gmane.org; Sat, 06 Oct 2018 20:15:33 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-Injection-Info: reader02.eternal-september.org; posting-host="bc00f795f19f8e402c6d9f54b967ff31"; logging-data="16443"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+v/gVvi3Qnc3Qrcb+Cqw855VcPNp0vIdI=" Cancel-Lock: sha1:KcLvkYKGqfp3IT3D8imZ+0W6aao= sha1:D52uhsE9s67RAZnjmZcOBSWhq1c= X-BSB-Auth: 1.0136c53cdeaf96928ba7.20181007011238BST.871s92iphl.fsf@bsb.me.uk Original-Xref: usenet.stanford.edu gnu.emacs.help:224044 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:118170 Archived-At: kjonca@poczta.onet.pl (Kamil Jońca) writes: > "Garreau, Alexandre" writes: > >> On 2018-10-06 at 12:39, Teemu Likonen wrote: >>> Kamil Jońca [2018-10-06 11:02:54+02] wrote: >>> >>>> For some time emacs view pdf files with its internal viewer. But I >>>> want to keep old behavior - open them with xpdf/evince How can I do >>>> it? >>> >>> You can use mailcap-user-mime-data variable to override the (generated) >>> defaults in mailcap-mime-data: >>> >>> (setq mailcap-user-mime-data >>> '(((type . "application/pdf") >>> (viewer . "evince %s")))) >> >> My emacs uses its internal viewer doc view, and yet I see this in my >> predefined (I didn’t touch it myself) mailcap-user-mime-data: >> >> #+BEGIN_SRC elisp >> ("pdf" >> (viewer . "okular '%s'") >> (type . "application/pdf") >> (test "test" "\"$DISPLAY\"" "!=" "\"\"") >> ("nametemplate" . "%s.pdf")) >> #+END_SRC >> > Are you sure you speak about mailcap-user-mime-data, not > mailcap-mime-data? Part of the trouble is that mailcap.el defines a sort function that favours symbols over strings. As a result, no matter what viewer command you have, 'doc-view-mode will win out. I have used a temporary fix which is to have (require 'mailcap) (setq mailcap-mime-data nil) (mailcap-parse-mailcaps nil t) in .emacs. This is a crude fix, but it works for the time being. I started a thread about this a few days ago in comp.emacs and there have been some other ideas along the line of code to pickout the 'doc-view-mode a-list entries. -- Ben.