Gnus development mailing list
 help / color / mirror / Atom feed
* nuke unread messages
@ 2013-02-19 14:35 Julien Cubizolles
  2013-08-01 21:12 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Julien Cubizolles @ 2013-02-19 14:35 UTC (permalink / raw)
  To: ding

A long time ago (1996) there was a discussion on this list about a
function to expire all messages, even unread ones. I can think of a few
uses for newsletters (annoucements of movies/books/concerts,
advertisments). Lars suggested to name it nuke-everything.

Was it coded ? I couldn't find a nuke-* function in gnus.

Julien.




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

* Re: nuke unread messages
  2013-02-19 14:35 nuke unread messages Julien Cubizolles
@ 2013-08-01 21:12 ` Lars Magne Ingebrigtsen
  2013-08-02  5:56   ` Julien Cubizolles
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2013-08-01 21:12 UTC (permalink / raw)
  To: Julien Cubizolles; +Cc: ding

Julien Cubizolles <j.cubizolles@free.fr> writes:

> A long time ago (1996) there was a discussion on this list about a
> function to expire all messages, even unread ones. I can think of a few
> uses for newsletters (annoucements of movies/books/concerts,
> advertisments). Lars suggested to name it nuke-everything.

There's the `gnus-group-delete-articles' command in the group buffer.
It's not bound to any keys.

-- 
(domestic pets only, the antidote for overdose, milk.)
  No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php



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

* Re: nuke unread messages
  2013-08-01 21:12 ` Lars Magne Ingebrigtsen
@ 2013-08-02  5:56   ` Julien Cubizolles
  2013-08-02 12:52     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Julien Cubizolles @ 2013-08-02  5:56 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Julien Cubizolles <j.cubizolles@free.fr> writes:
>
>> A long time ago (1996) there was a discussion on this list about a
>> function to expire all messages, even unread ones. I can think of a few
>> uses for newsletters (annoucements of movies/books/concerts,
>> advertisments). Lars suggested to name it nuke-everything.
>
> There's the `gnus-group-delete-articles' command in the group buffer.
> It's not bound to any keys.
Thanks for taking the time to reply to such an ancient message.

Actually I don't want to delete all articles, only expire
them. Basically I want all articles in a given group to be deleted after
a custom expiry time, regardless of their read status.

Julien.




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

* Re: nuke unread messages
  2013-08-02  5:56   ` Julien Cubizolles
@ 2013-08-02 12:52     ` Lars Magne Ingebrigtsen
  2013-08-03  6:54       ` Julien Cubizolles
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2013-08-02 12:52 UTC (permalink / raw)
  To: Julien Cubizolles; +Cc: ding

Julien Cubizolles <j.cubizolles@free.fr> writes:

> Actually I don't want to delete all articles, only expire
> them. Basically I want all articles in a given group to be deleted after
> a custom expiry time, regardless of their read status.

Ah, I see.  I've now made `gnus-group-delete-articles' accept a prefix
arg that will only delete "old" articles.

I haven't actually tested the code, though.  >"?

-- 
(domestic pets only, the antidote for overdose, milk.)
  No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php



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

* Re: nuke unread messages
  2013-08-02 12:52     ` Lars Magne Ingebrigtsen
@ 2013-08-03  6:54       ` Julien Cubizolles
  2013-08-03 11:38         ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Julien Cubizolles @ 2013-08-03  6:54 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Ah, I see.  I've now made `gnus-group-delete-articles' accept a prefix
> arg that will only delete "old" articles.
>
> I haven't actually tested the code, though.  >"?

It doesn't seem to work. I have gnus-agent-expire-days set to 30.

On a given nnimap group in the *Group* buffer, running C-u M-x
gnus-group-delete-articles offer to delete some articles. However, after
having answered yes, the messages are still there.

If I'm in the *Summary* for the same nnimap group, running the same
function offer to delete 0 articles, as does evaluating
(gnus-group-delete-articles "nnimap+free:test" 'oldp).

Answering yes gives the following error: gnus-request-expire-articles:
Wrong type argument: stringp, nil

I had in mind an expiry method to achieve this but
gnus-group-delete-articles has the advantage that you can run for just
one shot. I guess I could add this function to the right hook to have it
run on visiting each group marked with a new group parameter. What do
you think ?

Julien.



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

* Re: nuke unread messages
  2013-08-03  6:54       ` Julien Cubizolles
@ 2013-08-03 11:38         ` Lars Magne Ingebrigtsen
  2013-08-04 16:59           ` Julien Cubizolles
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2013-08-03 11:38 UTC (permalink / raw)
  To: Julien Cubizolles; +Cc: ding

Julien Cubizolles <j.cubizolles@free.fr> writes:

> It doesn't seem to work. I have gnus-agent-expire-days set to 30.

`nnmail-expiry-wait' is what controls expiry.

> On a given nnimap group in the *Group* buffer, running C-u M-x
> gnus-group-delete-articles offer to delete some articles. However, after
> having answered yes, the messages are still there.

Works for me.  I just tried it on an nnimap group, and it deleted all
messages in that group that were older than seven days.

-- 
(domestic pets only, the antidote for overdose, milk.)
  No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php



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

* Re: nuke unread messages
  2013-08-03 11:38         ` Lars Magne Ingebrigtsen
@ 2013-08-04 16:59           ` Julien Cubizolles
  2013-08-05  2:41             ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Julien Cubizolles @ 2013-08-04 16:59 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:


> `nnmail-expiry-wait' is what controls expiry.

>> On a given nnimap group in the *Group* buffer, running C-u M-x
>> gnus-group-delete-articles offer to delete some articles. However, after
>> having answered yes, the messages are still there.
>
> Works for me.  I just tried it on an nnimap group, and it deleted all
> messages in that group that were older than seven days.

I have nnmail-expiry-wait set at 7 also but the problem remains. Do you
run gnus-group-delete-articles from the *Group* buffer or the *Summary*
buffer ? Could the different behaviour be due to some agent settings
about expiry ?

Julien.




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

* Re: nuke unread messages
  2013-08-04 16:59           ` Julien Cubizolles
@ 2013-08-05  2:41             ` Lars Magne Ingebrigtsen
  2013-08-05  6:06               ` Julien Cubizolles
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2013-08-05  2:41 UTC (permalink / raw)
  To: Julien Cubizolles; +Cc: ding

Julien Cubizolles <j.cubizolles@free.fr> writes:

> I have nnmail-expiry-wait set at 7 also but the problem remains. Do you
> run gnus-group-delete-articles from the *Group* buffer or the *Summary*
> buffer ?

The group buffer.

> Could the different behaviour be due to some agent settings about
> expiry ?

No, the agent settings don't affect expiry on the server.

-- 
(domestic pets only, the antidote for overdose, milk.)
  No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php
  and http://lars.ingebrigtsen.no/2013/08/twenty-years-of-september.html



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

* Re: nuke unread messages
  2013-08-05  2:41             ` Lars Magne Ingebrigtsen
@ 2013-08-05  6:06               ` Julien Cubizolles
  2013-08-05 17:58                 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Julien Cubizolles @ 2013-08-05  6:06 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

>> Could the different behaviour be due to some agent settings about
>> expiry ?
>
> No, the agent settings don't affect expiry on the server.

I've also tried it on a nnml group, I still get the same behaviour:
nothing is deleted even though I answer yes to "do you want to delete
these messages forever". What could possibly prevent these messages from
being deleted ?

Julien.




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

* Re: nuke unread messages
  2013-08-05  6:06               ` Julien Cubizolles
@ 2013-08-05 17:58                 ` Lars Magne Ingebrigtsen
  2013-08-06  5:16                   ` Julien Cubizolles
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2013-08-05 17:58 UTC (permalink / raw)
  To: Julien Cubizolles; +Cc: ding

Julien Cubizolles <j.cubizolles@free.fr> writes:

> I've also tried it on a nnml group, I still get the same behaviour:
> nothing is deleted even though I answer yes to "do you want to delete
> these messages forever". What could possibly prevent these messages from
> being deleted ?

Do a debug-on-entry on `nnml-request-expire-articles' and see what
parameters it's called with.  It should be the list of all articles in
the group, and FORCE should be nil, which should make nnml delete the
messages on that list that are "old".

-- 
(domestic pets only, the antidote for overdose, milk.)
  No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php
  and http://lars.ingebrigtsen.no/2013/08/twenty-years-of-september.html



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

* Re: nuke unread messages
  2013-08-05 17:58                 ` Lars Magne Ingebrigtsen
@ 2013-08-06  5:16                   ` Julien Cubizolles
  2013-08-06 14:03                     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Julien Cubizolles @ 2013-08-06  5:16 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Julien Cubizolles <j.cubizolles@free.fr> writes:
>
>> I've also tried it on a nnml group, I still get the same behaviour:
>> nothing is deleted even though I answer yes to "do you want to delete
>> these messages forever". What could possibly prevent these messages from
>> being deleted ?
>
> Do a debug-on-entry on `nnml-request-expire-articles' and see what
> parameters it's called with.  It should be the list of all articles in
> the group, and FORCE should be nil,

I think it is, see the following trace. The group is called "test" and 
gnus-select-method is (nnml "local").

Julien.

--8<---------------cut here---------------start------------->8---
Debugger entered--entering a function:
* apply(#[(articles group &optional server force) "\306\b	\"\210\n\307\f!\310)\311\b	\"*\312\211+,\312\211-.\312/\313\314!\210\315\316\"\3170\"00\203\b\x0e)\203\b\3200\211A0@\211.!\211+\203\376\321\322+!8\211-\203\376\323\b.\"\203\376\324\b-12$\211)\203\376\x0e3\211/\325=\204\322\326\327!4r4q\210\330\216\331.\b	p$\210\312\211\21156\332/!\203\245\x0e/\b!//\203\313\x0e/\325=\204\313\333/!\204\277\334/!\203\310\335/\b\"\210\202\313\312/.\306\b	\"\210/\203\364\336\321\337.*$\210\312\340\341\217\210\342.\"\343\b.\"\210\2023\x0e.,B,\2023\x0e.,B,\2023\344\b7\"A@\2118\203(\x0e8\203\"\345\346\"\206&\x0e8AT\240\210\34779\"\210)\350 \210,0\244.	\207" [group server nnmail-pathname-coding-system file-name-coding-system nnml-current-directory active-articles nnml-possibly-change-directory nnml-directory-articles t nnml-decoded-group-name nil nnmail-activate nnml sort < gnus-sorted-intersection nnml-article-to-file 5 file-attributes nnml-deletable-article-p nnmail-expired-article-p delete generate-new-buffer " *temp*" ((byte-code "\301\b!\203\n\302\b!\210\301\207" [temp-buffer buffer-name kill-buffer] 2)) nnml-request-article functionp gnus-request-group gnus-request-create-group nnmail-expiry-target-group nnheader-message "Deleting article %s in %s" (funcall nnmail-delete-file-function article) ((file-error (byte-code "\b	B\302\207" [number rest nil] 2))) delq nnml-nov-delete-article assoc apply min nnmail-save-active nnml-save-nov is-old decoded article rest mod-time number target articles force ...] 6] ((73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102) "test" "local" nil))
* nnml-request-expire-articles((73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102) "test" "local" nil)
  gnus-request-expire-articles((73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102) "test" nil)
  gnus-group-delete-articles("test" (4))
  call-interactively(gnus-group-delete-articles record nil)
  command-execute(gnus-group-delete-articles record)
  execute-extended-command((4) "gnus-group-delete-articles")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)
--8<---------------cut here---------------end--------------->8---



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

* Re: nuke unread messages
  2013-08-06  5:16                   ` Julien Cubizolles
@ 2013-08-06 14:03                     ` Lars Magne Ingebrigtsen
  2013-08-07  8:34                       ` Julien Cubizolles
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2013-08-06 14:03 UTC (permalink / raw)
  To: Julien Cubizolles; +Cc: ding

Julien Cubizolles <j.cubizolles@free.fr> writes:

> I think it is, see the following trace. The group is called "test" and 
> gnus-select-method is (nnml "local").

[...]

> * nnml-request-expire-articles((73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102) "test" "local" nil)

So these articles (73-102) are old, but they aren't deleted?  What does
ls -l on the files say?

-- 
(domestic pets only, the antidote for overdose, milk.)
  No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php
  and http://lars.ingebrigtsen.no/2013/08/twenty-years-of-september.html



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

* Re: nuke unread messages
  2013-08-06 14:03                     ` Lars Magne Ingebrigtsen
@ 2013-08-07  8:34                       ` Julien Cubizolles
  0 siblings, 0 replies; 13+ messages in thread
From: Julien Cubizolles @ 2013-08-07  8:34 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> So these articles (73-102) are old, but they aren't deleted?  What does
> ls -l on the files say?

I think that's the problem. I created this group for testing and copied
old (received more than a year ago) messages in it. But the files
themselves are new (less than a week ago). When I set nnmail-expiry-wait
to 1, the messages are indeed deleted.

I was assuming that the old/new propriety was referring to the date in
the headers of the message itself and there seems to be a confusion in
gnus-group-delete-articles also since it proposes to delete them
(implying they are old) but refuses to actually do it (as if they are
new).

Anyway, for a real use case, it's working as I want it to be : removing
all old articles in a group even if they have not been read.

Thanks for your help in investigating this.

Julien.




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

end of thread, other threads:[~2013-08-07  8:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-19 14:35 nuke unread messages Julien Cubizolles
2013-08-01 21:12 ` Lars Magne Ingebrigtsen
2013-08-02  5:56   ` Julien Cubizolles
2013-08-02 12:52     ` Lars Magne Ingebrigtsen
2013-08-03  6:54       ` Julien Cubizolles
2013-08-03 11:38         ` Lars Magne Ingebrigtsen
2013-08-04 16:59           ` Julien Cubizolles
2013-08-05  2:41             ` Lars Magne Ingebrigtsen
2013-08-05  6:06               ` Julien Cubizolles
2013-08-05 17:58                 ` Lars Magne Ingebrigtsen
2013-08-06  5:16                   ` Julien Cubizolles
2013-08-06 14:03                     ` Lars Magne Ingebrigtsen
2013-08-07  8:34                       ` Julien Cubizolles

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