Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-dired-attach: default mime-type application/octet-stream, why
@ 2014-07-20 21:24 Uwe Brauer
  2015-01-28  4:11 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Brauer @ 2014-07-20 21:24 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 1071 bytes --]

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 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5556 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gnus-dired-attach: default mime-type application/octet-stream, why
  2014-07-20 21:24 gnus-dired-attach: default mime-type application/octet-stream, why Uwe Brauer
@ 2015-01-28  4:11 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2015-01-28  4:11 UTC (permalink / raw)
  To: ding

Uwe Brauer <oub@mat.ucm.es> writes:

> 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.

> 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/



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-28  4:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-20 21:24 gnus-dired-attach: default mime-type application/octet-stream, why Uwe Brauer
2015-01-28  4:11 ` Lars Ingebrigtsen

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 NNTP newsgroup(s).