[emacs-w3m:13846] Re: Support MIME type application/emacs-lisp

Katsumi Yamaoka <[email protected]> Fri, 17 Sep 2021 09:03:49 +0900
Newsgroups gmane.emacs.w3m
Organization Emacsen advocacy group
Message-ID <[email protected]>
In [emacs-w3m:13845]
On Thu, 16 Sep 2021 12:35:55 -0700, [email protected] wrote:

> I've found a small bug. When I went to a website with an emacs lisp file, I
> got a strange message from emacs-w3m (version
> 1.4.632+0.20210201.2305.54c3ccd-1):

>> Reading https://jblevins.org/projects/markdown-mode/markdown-mode.el ...

Oh, sorry.  I found I cannot read it as well.  Thank you for
pointing it out.  I've taken emergency measures in the git master
so that emacs-w3m shows contents of the "application/emacs-lisp"
type as the "text/plain" type.  It might not be the best solution,
though.


Recently emacs-w3m uses Emacs' mailcap facility.  If you have
an interest in the emacs-w3m internals, try evaluating this form
(copy it to the *scratch* buffer and type C-j at the end):

(assoc "application/emacs-lisp" w3m-content-type-alist)

The 3rd and the 4th elements of the return value show how emacs-w3m
shows contents of the application/emacs-lisp type (see the doc
string of the `w3m-content-type-alist' variable for what those
elements mean).  In my Cygwin platform I got:

("application/emacs-lisp" "\\.el\\'" (mailcap-mime-info "application/emacs-lisp") nil)

Where the 3rd element means:
(mailcap-mime-info "application/emacs-lisp")
 => "cygstart %s"
;; cygstart is the one similar to xdg-open, fiber, etc.

But cygstart doesn't know what the *.el file is of course.

Regards,