bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52038: Completion for user mailcap entries


From: Arash Esbati
Subject: bug#52038: Completion for user mailcap entries
Date: Sun, 02 Oct 2022 11:58:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

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 via email to

[Prev in Thread] Current Thread [Next in Thread]