Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-dired-attach, optionally type?
@ 2013-06-14 12:13 Uwe Brauer
  2013-06-14 14:49 ` Eric S Fraga
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Brauer @ 2013-06-14 12:13 UTC (permalink / raw)
  To: ding


Hi 

 mml-dired-attach is rather rigid, since it does not allow to chose the
 attchment type. I propose to add this functionality, at least
 optionally.

I looked into the code and a modification looks complicated, could
somebody more familiar with the code try it?


thanks

Uwe Brauer 




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

* Re: gnus-dired-attach, optionally type?
  2013-06-14 12:13 gnus-dired-attach, optionally type? Uwe Brauer
@ 2013-06-14 14:49 ` Eric S Fraga
  2013-06-14 20:57   ` Uwe Brauer
  2013-06-14 22:10   ` Uwe Brauer
  0 siblings, 2 replies; 6+ messages in thread
From: Eric S Fraga @ 2013-06-14 14:49 UTC (permalink / raw)
  To: ding

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

> Hi 
>
>  mml-dired-attach is rather rigid, since it does not allow to chose the
>  attchment type. I propose to add this functionality, at least
>  optionally.

I must admit that I have never found a need for this
functionality.  Either I add the type (if new) to mime.types or I simply
edit the message buffer as the attachment information is just text...

-- 
: Eric S Fraga, GnuPG: 0xFFFCF67D
: in Emacs 24.3.50.1 + Ma Gnus v0.8 + evil 1.0-dev
: BBDB version 3.02 ($Date: 2013/05/15 13:17:58 $)




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

* Re: gnus-dired-attach, optionally type?
  2013-06-14 14:49 ` Eric S Fraga
@ 2013-06-14 20:57   ` Uwe Brauer
  2013-06-14 22:10   ` Uwe Brauer
  1 sibling, 0 replies; 6+ messages in thread
From: Uwe Brauer @ 2013-06-14 20:57 UTC (permalink / raw)
  To: ding

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

>> "Eric" == Eric S Fraga <Eric> writes:

   > Uwe Brauer <oub@mat.ucm.es> writes:
   >> Hi 
   >> 
   >> mml-dired-attach is rather rigid, since it does not allow to chose the
   >> attchment type. I propose to add this functionality, at least
   >> optionally.

   > I must admit that I have never found a need for this
   > functionality.  Either I add the type (if new) to mime.types or I simply
   > edit the message buffer as the attachment information is just text...

Hm..
Suppose you want to attach say 10 files, which are of the "wrong type",
application/octet-stream instead of 
then you are suggesting a simple query replace!?

The  Problem which this approach  is that I don't know
by heart the correct type, for example is it plain/text or text/plain??

While if I use mml-attach-file, present you a list of options. I presume
the next step is you propose a simple function which covers the most
useful changes?

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

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

* Re: gnus-dired-attach, optionally type?
  2013-06-14 14:49 ` Eric S Fraga
  2013-06-14 20:57   ` Uwe Brauer
@ 2013-06-14 22:10   ` Uwe Brauer
  2013-06-16  4:35     ` Dave Goldberg
  1 sibling, 1 reply; 6+ messages in thread
From: Uwe Brauer @ 2013-06-14 22:10 UTC (permalink / raw)
  To: ding

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

>> "Eric" == Eric S Fraga <Eric> writes:

   > Uwe Brauer <oub@mat.ucm.es> writes:
   >> Hi 
   >> 
   >> mml-dired-attach is rather rigid, since it does not allow to chose the
   >> attchment type. I propose to add this functionality, at least
   >> optionally.

   > I must admit that I have never found a need for this
   > functionality.  Either I add the type (if new) to mime.types or I simply
   > edit the message buffer as the attachment information is just text...
When I change in gnus-dired-attach

	(mml-attach-file (car files-to-attach)
			 (or (mm-default-file-encoding (car files-to-attach))
			     "application/octet-stream") nil)

To 

	(mml-attach-file (car files-to-attach)
			     (mml-minibuffer-read-type (car files-to-attach)) )

Then it works as I expect, however the interactive call of that function
is too complicated for me, usually I would do a

(defun my-dired-attach (&optional arg)
  (interactive "P")
   (if arg
   (New code)
   (old code)))

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

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

* Re: gnus-dired-attach, optionally type?
  2013-06-14 22:10   ` Uwe Brauer
@ 2013-06-16  4:35     ` Dave Goldberg
  2013-06-16  7:50       ` Uwe Brauer
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Goldberg @ 2013-06-16  4:35 UTC (permalink / raw)
  To: ding

> [...]
> Then it works as I expect, however the interactive call of that function
> is too complicated for me, usually I would do a

> (defun my-dired-attach (&optional arg)
>   (interactive "P")
>    (if arg
>    (New code)
>    (old code)))

It looks like you are writing a modified version of gnus-dired-attach, along with the above wrapper.  If that's correct then I think this will work.  I haven't tested with this specific case, but it's worked for others:

(defun my-dired-attach (&optional arg)
  (interactive "P")
  (if arg
      (call-interactively 'modified-gnus-dired-attach)
    (call-interactively 'gnus-dired-attach)))

I think you can do something similar with defadvice but I haven't used that.

-- 
Dave Goldberg
david.goldberg6@verizon.net



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

* Re: gnus-dired-attach, optionally type?
  2013-06-16  4:35     ` Dave Goldberg
@ 2013-06-16  7:50       ` Uwe Brauer
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Brauer @ 2013-06-16  7:50 UTC (permalink / raw)
  To: ding

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

>> "Dave" == Dave Goldberg <david.goldberg6@verizon.net> writes:

   >> (defun my-dired-attach (&optional arg)
   >> (interactive "P")
   >> (if arg
   >> (New code)
   >> (old code)))

   > It looks like you are writing a modified version of
   > gnus-dired-attach, along with the above wrapper.  If that's correct
   > then I think this will work.  I haven't tested with this specific
   > case, but it's worked for others:

   > (defun my-dired-attach (&optional arg)
   >   (interactive "P")
   >   (if arg
   >       (call-interactively 'modified-gnus-dired-attach)
   >     (call-interactively 'gnus-dired-attach)))

Right precisely, I tried that but without the call-interactively.

I originally thought to modify *directly* gnus-dired-attach,[1] but as I
said its interactive structure is too complex for me. Also it seems that
most users don't think such a patch is necessary.


   > I think you can do something similar with defadvice but I haven't
   > used that.

I have decided to avoid defadvice if possible, it is just almost
impossible to debug.

thanks

Uwe 

Footnotes:
[1]  one function to rule them all.


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

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

end of thread, other threads:[~2013-06-16  7:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-14 12:13 gnus-dired-attach, optionally type? Uwe Brauer
2013-06-14 14:49 ` Eric S Fraga
2013-06-14 20:57   ` Uwe Brauer
2013-06-14 22:10   ` Uwe Brauer
2013-06-16  4:35     ` Dave Goldberg
2013-06-16  7:50       ` Uwe Brauer

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