From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arash Esbati Newsgroups: gmane.emacs.bugs Subject: bug#52038: Completion for user mailcap entries Date: Sun, 02 Oct 2022 11:58:03 +0200 Message-ID: <864jwmmtsk.fsf@gnu.org> References: <864k842vh7.fsf@gnu.org> <87czbkevs3.fsf@gnus.org> <86h70o80ws.fsf@gnu.org> <874jwnj1i0.fsf@gnus.org> <87pmfbfzma.fsf@gnus.org> <868rlymxbk.fsf@gnu.org> <874jwmmwhr.fsf@linux-m68k.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38662"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 Cc: Lars Ingebrigtsen , 52038@debbugs.gnu.org To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 02 11:59:11 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oevkb-0009s5-JW for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Oct 2022 11:59:09 +0200 Original-Received: from localhost ([::1]:43976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oevka-0001Oc-K5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Oct 2022 05:59:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oevkU-0001OD-CU for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2022 05:59:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47227) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oevkU-0007C2-4j for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2022 05:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oevkT-0004tT-Vj for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2022 05:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Arash Esbati Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Oct 2022 09:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52038 X-GNU-PR-Package: emacs Original-Received: via spool by 52038-submit@debbugs.gnu.org id=B52038.166470470718770 (code B ref 52038); Sun, 02 Oct 2022 09:59:01 +0000 Original-Received: (at 52038) by debbugs.gnu.org; 2 Oct 2022 09:58:27 +0000 Original-Received: from localhost ([127.0.0.1]:46305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oevjv-0004sg-1S for submit@debbugs.gnu.org; Sun, 02 Oct 2022 05:58:27 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oevjt-0004sT-H3 for 52038@debbugs.gnu.org; Sun, 02 Oct 2022 05:58:25 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oevjn-00079g-Mw; Sun, 02 Oct 2022 05:58:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=7Nn92McpTS0HRBFB658VKcX8xxQPuaIJNGgncQLqOys=; b=TIXBCcQ5uaJeMhuETuJK fg6xfC6BR8g8ViAfsJBrzJX66NIMYDALhGRjLtgcZCrMQ7QSviYM/cqVFN6N3mNU/Y54AeNK6nUYs oe73yW8mfoy5Sr11huHywLd5IozLbvh/nUv5z7J88FwBW0xWNWl6XZzBzVgDAKDuIlJaleaLYPzuw iRtptucPEBXI4UfI3tV/f98T14REnPUKXBkz+inBdhSBQU4+jA97c5p82mHfyUqKYJC1sKlNcBx9E VH0kvUQgc6YGPRty/CepobyfDr8v8llcs1sGp47iPokYLV9Yn+sAZFNwzVBEi7xrveDF+Lww64Ce0 G+OdTuZZq+YZpw==; Original-Received: from pd9fb7965.dip0.t-ipconnect.de ([217.251.121.101]:54456 helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oevjn-00024X-8z; Sun, 02 Oct 2022 05:58:19 -0400 In-Reply-To: <874jwmmwhr.fsf@linux-m68k.org> (Andreas Schwab's message of "Sun, 02 Oct 2022 10:59:44 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244195 Archived-At: Andreas Schwab writes: > On Okt 02 2022, Arash Esbati wrote: > >> diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el >> index aa0c172655..a0355f876b 100644 >> --- a/lisp/net/mailcap.el >> +++ b/lisp/net/mailcap.el >> @@ -303,9 +303,9 @@ mailcap-mime-data >> Which looks like: >> ----------------- >> ((\"application\" >> - (\"postscript\" . )) >> + (\"postscript\" )) >> (\"text\" >> - (\"plain\" . ))) >> + (\"plain\" ))) >> >> Where is another assoc list of the various information >> related to the mailcap RFC 1524. This is keyed on the lowercase >> >> The way I understand it the 2nd assoc list isn't a dotted pair where >> contains dotted pairs. > > This is wrong. is a list that is the cdr of the containing list. > In the definition of mailcap-mime-data the list is spliced into > its parent, since you can always write '(a . (b c)) as '(a b c). Thanks for your response. Unless I'm totally confused, I think there is mismatch between the implementation of `mailcap-mime-data' and its docstring. This is an excerpt of the long defvar: --8<---------------cut here---------------start------------->8--- (defvar mailcap-mime-data `(("application" ("postscript" (viewer . "gv -safer %s") (type . "application/postscript") (test . window-system) ("print" . ,(concat mailcap-print-command " %s")) ("needsx11")) ("pgp-keys" (viewer . "gpg --import --interactive --verbose") (type . "application/pgp-keys") ("needsterminal"))) ("text" ("plain" (viewer . view-mode) (type . "text/plain")) ("plain" (viewer . fundamental-mode) (type . "text/plain")) ("enriched" (viewer . enriched-decode) (type . "text/enriched")) ("dns" (viewer . dns-mode) (type . "text/dns"))) ("archive" ("tar" (viewer . tar-mode) (type . "archive/tar")))) "The mailcap structure is an assoc list of assoc lists. 1st assoc list is keyed on the major content-type 2nd assoc list is keyed on the minor content-type (which can be a regexp) Which looks like: ----------------- ((\"application\" (\"postscript\" . )) (\"text\" (\"plain\" . ))) Where is another assoc list of the various information related to the mailcap RFC 1524. This is keyed on the lowercase attribute name (viewer, test, etc). This looks like: ((viewer . VIEWERINFO) (test . TESTINFO) (xxxx . \"STRING\") FLAG) [...]") --8<---------------cut here---------------end--------------->8--- So the outcome is correct, it is just confusing when you read the docstring and see that is done differently. Best, Arash