VM

deleting attachments

Bug #756247 reported by mere user
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
VM
Fix Released
Low
Tim Cross

Bug Description

hi Uday, vm-delete-all-attachments doesn't work for me for attachments such as the jpg image in the following email. should it? cheers, E

X-Mailer: YahooMailRC/559 YahooMailWebService/0.8.109.295617
Content-Type: multipart/alternative;
 boundary="0-1440180891-1302379389=:3436"
MIME-Version: 1.0

--0-1440180891-1302379389=:3436
Content-Type: text/plain; charset="us-ascii"

May 6-7. may need to drive there on the 5th

--0-1440180891-1302379389=:3436
Content-Type: multipart/related; boundary="0-828134094-1302379389=:3436"

--0-828134094-1302379389=:3436
Content-Type: text/html; charset="us-ascii"

<html><head>
blah blah

      </body></html>
--0-828134094-1302379389=:3436
Content-Type: image/jpeg; name="--blah.jpg"
Content-Transfer-Encoding: base64
Content-ID: <email address hidden>
Content-Disposition: inline

/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAUAAA/+4ADkFkb2JlAGTAAAAAAf/b
AIQAAgICAgICAgICAgMCAgIDBAMCAgMEBQQEBAQEBQYFBQUFBQUGBgcHCAcHBgkJCgoJCQwMDAwM
Y/4z+8/tW/3b6f8A1dNAXpQCgFAKAUAoBQCgFAWfkv8AF2v/AHvuufvH7v8AsZH7v/8AZ/8Ai66A
vCgFAKAUAoD/2Q==

--0-828134094-1302379389=:3436--

--0-1440180891-1302379389=:3436--

Tags: mime new

Related branches

Revision history for this message
Uday Reddy (reddyuday) wrote : Re: [Bug 756247] [NEW] deleting attachments

mere user writes:

> Public bug reported:
>
> hi Uday, vm-delete-all-attachments doesn't work for me for attachments
> such as the jpg image in the following email. should it? cheers, E

Not really. Check the doc-string for the function, which explains how
it works.

Cheers,
Uday

Revision history for this message
mere user (emacs-user) wrote :

On Sun, Apr 10, 2011 at 8:26 AM, Uday Reddy <email address hidden> wrote:
>> hi Uday, vm-delete-all-attachments doesn't work for me for attachments
>> such as the jpg image in the following email.  should it?  cheers, E
>
> Not really.  Check the doc-string for the function, which explains how
> it works.

thanks, that's helpful. interestingly, after starting vm I get:

vm-mime-deleteable-types is a variable defined in `vm-vars.el'.
Its value is ("application" "x-unknown" "application/x-gzip")

Original value was
("application" "x-unknown" "application/x-gzip" "text/plain"
"text/html" "image" "video/mpeg" "video" "application/pdf"
"application/x-pdf" "application/postscript" "application/ms-tnef"
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
"application/vnd.ms-excel" "application/vnd.ms-powerpoint"
"application/msword" "application/x-msword" "application/rtf"
"application/winword" "application/xfig" "video/x-ms-wmv")

and in customize:

Hide Vm Mime Deleteable Types:
INS DEL MIME type: application
INS DEL MIME type: x-unknown
INS DEL MIME type: application/x-gzip
INS
    State : CHANGED outside Customize.
   List of MIME types which should be deleted.
Groups: Vm Mime

now, I didn't change the value of this variable myself. if I do
'erase customization" it goes back to the fuller list which leads to
the behavior I was looking for. but next time I restart emacs it
reverts to this value. any clues? cheers, E

Revision history for this message
Uday Reddy (reddyuday) wrote :

emacs user writes:

> vm-mime-deleteable-types is a variable defined in `vm-vars.el'.
> Its value is ("application" "x-unknown" "application/x-gzip")

That is what is defined in VM (which is probably copied from
vm-rfaddons).

> Original value was...

I don't know where this came from. My guess is that you have it
defined in your .emacs file, and it is getting overridden by VM. If
you can find that definition and move it to your .vm file, that might
cure the problem.

Tim, do you have any idea what is causing this?

Cheers,
Uday

Changed in vm:
assignee: nobody → Tim Cross (tcross)
Revision history for this message
mere user (emacs-user) wrote :

On Sun, Apr 10, 2011 at 5:12 PM, Uday S Reddy <email address hidden> wrote:
> emacs user writes:
>
>> vm-mime-deleteable-types is a variable defined in `vm-vars.el'.
>> Its value is ("application" "x-unknown" "application/x-gzip")
>
> That is what is defined in VM (which is probably copied from
> vm-rfaddons).
>
>> Original value was...
>
> I don't know where this came from.  My guess is that you have it
> defined in your .emacs file, and it is getting overridden by VM.  If
> you can find that definition and move it to your .vm file, that might
> cure the problem.
>
> Tim, do you have any idea what is causing this?

I don't seem to be setting vm-mime-deleteable-types explicitly
anywhere in my .emacs .vm or .customize files. perhaps I do
something else that causes this. this variable is made equivalent to
an older one, but I didn't see how that could cause this. E

Revision history for this message
Uday Reddy (reddyuday) wrote :

emacs user writes:

> I don't seem to be setting vm-mime-deleteable-types explicitly
> anywhere in my .emacs .vm or .customize files. perhaps I do
> something else that causes this. this variable is made equivalent to
> an older one, but I didn't see how that could cause this. E

Have you tried emacs -q and emacs -Q?

Cheers,
Uday

Revision history for this message
mere user (emacs-user) wrote :

On Mon, Apr 11, 2011 at 4:23 AM, Uday S Reddy <email address hidden> wrote:
> emacs user writes:
>
>> I don't seem to be setting vm-mime-deleteable-types explicitly
>> anywhere in my .emacs .vm or .customize files.   perhaps I do
>> something else that causes this.  this variable is made equivalent to
>> an older one, but I didn't see how that could cause this.  E
>
> Have you tried emacs -q and emacs -Q?

admittedly I did not try that...

I am quite sure I am being silly as always, but the variable is defined as

(defcustom vm-mime-deleteable-types
  (append
   '("application" "x-unknown" "application/x-gzip")
   (mapcar (lambda (a) (car a))
           vm-mime-external-content-types-alist))
  "*List of MIME types which should be deleted."
    :group 'vm-mime
    :type '(repeat (string :tag "MIME type" nil)))
(defvaralias 'vm-mime-deletable-types
  'vm-mime-deleteable-types)

is it possible that vm-mime-external-content-types-alist is later set
to nil and this messes vm-mime-saveable-types? when its value changes
for me, it changes to ("application" "x-unknown" "application/x-gzip")
which appear in the above definition...

Revision history for this message
mere user (emacs-user) wrote :

On Mon, Apr 11, 2011 at 9:35 PM, emacs user <email address hidden> wrote:
> On Mon, Apr 11, 2011 at 4:23 AM, Uday S Reddy <email address hidden> wrote:
>> emacs user writes:
>>
>>> I don't seem to be setting vm-mime-deleteable-types explicitly
>>> anywhere in my .emacs .vm or .customize files.   perhaps I do
>>> something else that causes this.  this variable is made equivalent to
>>> an older one, but I didn't see how that could cause this.  E
>>
>> Have you tried emacs -q and emacs -Q?
>
> admittedly I did not try that...
>
> I am quite sure I am being silly as always, but the variable is defined as
>
> (defcustom vm-mime-deleteable-types
>  (append
>   '("application" "x-unknown" "application/x-gzip")
>   (mapcar (lambda (a) (car a))
>           vm-mime-external-content-types-alist))
>  "*List of MIME types which should be deleted."
>    :group 'vm-mime
>    :type '(repeat (string :tag "MIME type" nil)))
> (defvaralias 'vm-mime-deletable-types
>  'vm-mime-deleteable-types)
>
>
> is it possible that vm-mime-external-content-types-alist is later set
> to nil and this messes vm-mime-saveable-types?  when its value changes
> for me, it changes to ("application" "x-unknown" "application/x-gzip")
> which appear in the above definition...
>

in fact, I am setting vm-mime-external-content-types-alist myself.
that's probably the source of the problem. best, E

Revision history for this message
Uday Reddy (reddyuday) wrote :

emacs user writes:

> in fact, I am setting vm-mime-external-content-types-alist myself.
> that's probably the source of the problem. best, E

Yes, changing external-content-types-alist would affect the
saveable-types and deleteable-types.

But, if you are setting it in your .vm file, that value should stay
and get included in saveable-types and deletable-types. Is that not
happening?

Cheers,
Uday

Revision history for this message
Uday Reddy (reddyuday) wrote :

I propose that we get rid of the addition of external-content-types-alist in the setting of deleteable-types and saveable-types.

These cross-references depend on the evaluation order and cause confusion.

Cheers,
Uday

Changed in vm:
milestone: none → 8.2.0
status: New → Triaged
importance: Undecided → Low
Revision history for this message
mere user (emacs-user) wrote : Re: [Bug 756247] Re: deleting attachments
Download full text (4.3 KiB)

sorry for not replying to this earlier. I do get strange results from
the interaction of external types and deleteable types. I have in my
.vm:

(setq vm-mime-external-content-types-alist
      '(
 ;; linux:
; ("text/html" "firefox -remote 'openFILE(%f)' || firefox file://%f ")
; ("image" "xloadimage")
 ;; MacOSX:
 ("text/plain" "open %f")
 ("text/html" "open %f")
  ("image" "open -a Preview %f")
  ("video/mpeg" "open")
  ("video" "open %f")
  ("application/pdf" "acroread")
  ("application/x-pdf" "acroread")
; ("webmail/pdf" "acroread")
  ("application/postscript" "gv")
  ("application/ms-tnef" "tnef --number-backups")
  ("application/vnd.openxmlformats-officedocument.presentationml.presentation"
"open_powerpoint")
  ("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
"open_excel")
  ("application/vnd.openxmlformats-officedocument.wordprocessingml.document"
"open_word")
  ("application/vnd.ms-excel" "open_excel")
  ("application/vnd.ms-powerpoint" "open_powerpoint")
  ("application/msword" "open_word")
  ("application/x-msword" "open_word")
  ("application/rtf" "open_word")
  ("application/winword" "open_word")
  ("application/xfig" "xfig")
  ("video/x-ms-wmv" "open -a WMV Player %f")
  ))

and when I look at the value of deleteable types I get:

vm-mime-deleteable-types is a variable defined in `vm-vars.el'.
Its value is ("application" "x-unknown" "application/x-gzip")

Original value was
("application" "x-unknown" "application/x-gzip" "text/plain"
"text/html" "image" "video/mpeg" "video" "application/pdf"
"application/x-pdf" "application/postscript" "application/ms-tnef"
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
"application/vnd.ms-excel" "application/vnd.ms-powerpoint"
"application/msword" "application/x-msword" "application/rtf"
"application/winword" "application/xfig" "video/x-ms-wmv")

so at some point ("original value" above) it did get the right idea,
but then it reverted back to the three values ("application"
"x-unknown" "application/x-gzip"). adding external types to
deleteable types is not necessarily a bad idea if it works. but if it
cannot work then, of course...

best, Eli

On Mon, Apr 25, 2011 at 7:53 PM, Uday Reddy <email address hidden> wrote:
> I propose that we get rid of the addition of external-content-types-
> alist in the setting of deleteable-types and saveable-types.
>
> These cross-references depend on the evaluation order and cause
> confusion.
>
> Cheers,
> Uday
>
>
> ** Changed in: vm
>    Milestone: None => 8.2.0
>
> ** Changed in: vm
>       Status: New => Triaged
>
> ** Changed in: vm
>   Importance: Undecided => Low
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/756247
>
> Title:
>  deleting attachments
>
> Status in VM (View Mail) for Emacs:
>  Triaged
>
> Bug description:
>  hi Uday, vm-delete-all-attachments doesn't work for me for attachments
>  such as the jpg image in the following email.  should it?  cheers, E
>
>
>  ...

Read more...

Revision history for this message
Uday Reddy (reddyuday) wrote :

mere user writes:

> so at some point ("original value" above) it did get the right idea,
> but then it reverted back to the three values ("application"
> "x-unknown" "application/x-gzip"). adding external types to
> deleteable types is not necessarily a bad idea if it works. but if it
> cannot work then, of course...

The moral is to not depend on external-types-alist and set the variables
fully yourself.

I am not sure it is a good idea to insert the external-types either. For
instance, I have an external viewer defined for text/html, even though I
view it internally most of the time. It shouldn't be considered a
deleteable type just because there is an external viewer defined for it.
(This is not actually a problem with the defaults because Rob had excluded
all text types in the deletable-type-exceptions. But the principle is still
the same.)

Cheers,
Uday

Revision history for this message
mere user (emacs-user) wrote :

On Mon, Apr 25, 2011 at 9:38 PM, Uday Reddy <email address hidden> wrote:
>
> I am not sure it is a good idea to insert the external-types either.  For
> instance, I have an external viewer defined for text/html, even though I
> view it internally most of the time.  It shouldn't be considered a
> deleteable type just because there is an external viewer defined for it.

ok, sounds good to me

Uday Reddy (reddyuday)
tags: added: 8.2 mime
Changed in vm:
milestone: 8.2.0 → 8.2.0a
status: Triaged → Fix Committed
Uday Reddy (reddyuday)
tags: added: new
removed: 8.2
Uday Reddy (reddyuday)
Changed in vm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.