Function: mailcap-file-name-to-mime-type
mailcap-file-name-to-mime-type is a byte-compiled function defined in
mailcap.el.gz.
Signature
(mailcap-file-name-to-mime-type FILE-NAME)
Documentation
Return the MIME content type based on the FILE-NAME's extension.
For instance, "foo.png" will result in "image/png".
Probably introduced at or before Emacs version 27.1.
Source Code
;; Defined in /usr/src/emacs/lisp/net/mailcap.el.gz
(defun mailcap-file-name-to-mime-type (file-name)
"Return the MIME content type based on the FILE-NAME's extension.
For instance, \"foo.png\" will result in \"image/png\"."
(mailcap-extension-to-mime
(if (string-match "\\(\\.[^.]+\\)\\'" file-name)
(match-string 1 file-name)
"")))