From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#36771: 27.0.50; mailcap documentation and effect missmatch Date: Thu, 3 Oct 2019 01:38:53 +0200 Message-ID: References: <87ftmxnqw7.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="63819"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Lars Ingebrigtsen , 36771@debbugs.gnu.org To: Tomas Nordin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 03 01:40:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iFoED-000GTk-NZ for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Oct 2019 01:40:17 +0200 Original-Received: from localhost ([::1]:59944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFoEC-0000bf-Bf for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Oct 2019 19:40:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51619) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFoE0-0000bX-K8 for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 19:40:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFoDy-0005Ym-HC for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 19:40:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57910) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFoDy-0005YY-0x for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 19:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iFoDx-0006OT-PL for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 19:40:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87ftmxnqw7.fsf@posteo.net> Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Oct 2019 23:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36771 X-GNU-PR-Package: emacs Original-Received: via spool by 36771-submit@debbugs.gnu.org id=B36771.157005955324517 (code B ref 36771); Wed, 02 Oct 2019 23:40:01 +0000 Original-Received: (at 36771) by debbugs.gnu.org; 2 Oct 2019 23:39:13 +0000 Original-Received: from localhost ([127.0.0.1]:38498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFoDA-0006NL-Pd for submit@debbugs.gnu.org; Wed, 02 Oct 2019 19:39:13 -0400 Original-Received: from mail-pg1-f180.google.com ([209.85.215.180]:46694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFoD8-0006N8-EH for 36771@debbugs.gnu.org; Wed, 02 Oct 2019 19:39:11 -0400 Original-Received: by mail-pg1-f180.google.com with SMTP id a3so533389pgm.13 for <36771@debbugs.gnu.org>; Wed, 02 Oct 2019 16:39:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=KMxLzcqgTo3AfAC3a7PofH2d2YD5CeUbaF9E84VmMU4=; b=pGUycqegNKF6aSJF6pPybmi1tQRyA7o3X4PlltttntdQtOA+OUoJsyogngbxlHFrEB sDlfNKO0/rd8ZMAKXXMUBZ5HT/7dkfwwkH5TsxQi25pexIzHCNEClcTbB52PWdjwR/g6 TihXNaBL60KmK6jtk0k+AY+W06aEUZRvB49/MqNFsaxyXQwTwbYcn/RMddNJZpyvKT9j JisWNoort2EeMklUeBnZ/YUAlXVKLEcL0mN/AGoyn5oBca/CK6DYockZriA8yYnOnQhi P/1bYRIyoknlPqrRpu+TEapqcMIVjBbZfWNypWCDV8YR1IKqOygofmrhNwpNxE1rWprX ok5w== X-Gm-Message-State: APjAAAX8GrkOmXioRIHKsw9SN9Po8JHSqcDLVBGm5sGdsFfdNzILlWRd Fimv7AW9Sq2DkVwtDnmTEMW/qAqOLKn4mXJPSGA= X-Google-Smtp-Source: APXvYqwuMqhM+AwLc4v+ETH1pCskecnyDvrAB06zqbBnPT81cVg8c6gE+ySIYFn9U0m+jL8SfdMn8mofeb4b0ehwnXU= X-Received: by 2002:a17:90b:8d1:: with SMTP id ds17mr7368106pjb.106.1570059544446; Wed, 02 Oct 2019 16:39:04 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:168182 Archived-At: Tomas Nordin writes: > emacs -Q > > In the scratch buffer, eval each of the following: > > (require 'mailcap) > (mailcap-mime-info "text/html") ;; -> "view %s" > mailcap-prefer-mailcap-viewers ;; -> t > (setq mailcap-prefer-mailcap-viewers t) ;; -> nil > (mailcap-mime-info "text/html") ;; -> "/usr/bin/firefox-esr %s" > > I expect the result of mailcap-mime-info to be "/usr/bin/firefox-esr %s" > when mailcap-prefer-mailcap-viewers is t because the doc of that > variable says > > If non-nil, prefer viewers specified in ~/.mailcap. > If nil, the most specific viewer will be chosen, even if there is > a general override in ~/.mailcap. For instance, if /etc/mailcap > has an entry for "image/gif", that one will be chosen even if > you have an entry for "image/*" in your ~/.mailcap file. > > and > > $ cat ~/.mailcap | grep '^text/html' > text/html; /usr/bin/firefox-esr %s; description=HTML Text; test=test -n "$DISPLAY"; nametemplate=%s.html > > What do you think? Indeed, this seems to me like it's contradicting the doc string. > If you agree this is a bug, I could provide that a bisect session gave > me that it started to behave this way by commit > 7e47d44da4b54c518c5e09b4f3d58dafdd43033d Lars, that commit is yours. What do you think? I tried digging into this code, but found mailcap.el too confusing overall... > In addition I am confused why mailcap-mime-info produces "view %s" in > any case because > > $ cat /etc/mailcap | grep '^text/html' > text/html; /usr/bin/sensible-browser %s; description=HTML Text; nametemplate=%s.html > text/html; /usr/bin/firefox-esr %s; description=HTML Text; test=test -n "$DISPLAY"; nametemplate=%s.html > text/html; gnome-builder %s; test=test -n "$DISPLAY" > text/html; /usr/bin/w3m -T text/html %s; needsterminal; description=HTML Text; nametemplate=%s.html > text/html; /usr/bin/w3m -I %{charset} -dump -T text/html %s; copiousoutput; description=HTML Text; nametemplate=%s.html > > I would naively think that the above would result in sensible-browser maybe. Agreed. Here I would have expected to get the more specific entry, but I get the least specific entry. On my system "view" in /etc/mailcap is: text/*; view %s; edit=vim %s; compose=vim %s; test=test -x /usr/bin/vim; needsterminal text/*; view %s; edit=vi %s; compose=vi %s; needsterminal Best regards, Stefan Kangas