unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Arash Esbati <arash@gnu.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 52038@debbugs.gnu.org
Subject: bug#52038: Completion for user mailcap entries
Date: Sun, 02 Oct 2022 11:58:03 +0200	[thread overview]
Message-ID: <864jwmmtsk.fsf@gnu.org> (raw)
In-Reply-To: <874jwmmwhr.fsf@linux-m68k.org> (Andreas Schwab's message of "Sun, 02 Oct 2022 10:59:44 +0200")

Andreas Schwab <schwab@linux-m68k.org> 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\" . <info>))
>> +   (\"postscript\" <info>))
>>    (\"text\"
>> -   (\"plain\" . <info>)))
>> +   (\"plain\" <info>)))
>>
>>  Where <info> 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
>> <info> contains dotted pairs.
>
> This is wrong.  <info> is a list that is the cdr of the containing list.
> In the definition of mailcap-mime-data the <info> 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\" . <info>))
  (\"text\"
   (\"plain\" . <info>)))

Where <info> 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





  reply	other threads:[~2022-10-02  9:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 13:03 bug#52038: Completion for user mailcap entries Arash Esbati
2022-09-24 13:39 ` Lars Ingebrigtsen
2022-10-01  7:21   ` Arash Esbati
2022-10-01 10:12     ` Lars Ingebrigtsen
2022-10-01 13:21       ` Lars Ingebrigtsen
2022-10-02  8:41         ` Arash Esbati
2022-10-02  8:59           ` Andreas Schwab
2022-10-02  9:58             ` Arash Esbati [this message]
2022-10-02 10:05               ` Andreas Schwab
2022-10-02 11:21                 ` Arash Esbati
2022-10-02 12:08                   ` Andreas Schwab
2022-10-02 12:13                   ` Lars Ingebrigtsen
2022-10-02 13:02                     ` Arash Esbati

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=864jwmmtsk.fsf@gnu.org \
    --to=arash@gnu.org \
    --cc=52038@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).