Discussion:
gnus-dired-attach: default mime-type application/octet-stream, why
Uwe Brauer
2014-07-20 21:24:04 UTC
Permalink
Hello

Why is the mime-type for gnus-dired-attach set for all attachments to
application/octet-stream?

The relevant code is this
(while files-to-attach
(mml-attach-file (car files-to-attach)
(or (mm-default-file-encoding (car files-to-attach))
"application/octet-stream") nil)
(setq files-to-attach (cdr files-to-attach)))

Which could be changed to
(while files-to-attach
(mml-attach-file (car files-to-attach)
(or (mm-default-file-encoding (car files-to-attach))
type) nil)


Another possibility is to have a wrapper which uses either the original
or the new function, something like this

(defun gnus-dired-attach-arg (&optional arg)
"Wrapper to call either the orginal functions which uses type
`application/octet-stream' or the new function which guesses the
type, in the same way `mml-attach-file' does this."
(interactive "P")
(if arg
(call-interactively 'gnus-dired-attach-guess)
(call-interactively 'gnus-dired-attach)))


Any comments? I have a patch.

Uwe Brauer
Lars Ingebrigtsen
2015-01-28 04:11:41 UTC
Permalink
Post by Uwe Brauer
Why is the mime-type for gnus-dired-attach set for all attachments to
application/octet-stream?
The relevant code is this
(while files-to-attach
(mml-attach-file (car files-to-attach)
(or (mm-default-file-encoding (car files-to-attach))
"application/octet-stream") nil)
(setq files-to-attach (cdr files-to-attach)))
It's only set to application/octet-stream if `mm-default-file-encoding'
isn't able to figure out what the type is.
Post by Uwe Brauer
Which could be changed to
(while files-to-attach
(mml-attach-file (car files-to-attach)
(or (mm-default-file-encoding (car files-to-attach))
type) nil)
Where does that `type' variable come from?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Loading...