From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/83078 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.gnus.general Subject: Expiring old low-score threads Date: Wed, 17 Apr 2013 13:16:59 +0200 Message-ID: <87r4i9iez8.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1366197500 12531 80.91.229.3 (17 Apr 2013 11:18:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Apr 2013 11:18:20 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M31344@lists.math.uh.edu Wed Apr 17 13:18:24 2013 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1USQNa-0005W3-EV for ding-account@gmane.org; Wed, 17 Apr 2013 13:18:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1USQMR-0000Oh-Bs; Wed, 17 Apr 2013 06:17:11 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1USQMP-0000OQ-3I for ding@lists.math.uh.edu; Wed, 17 Apr 2013 06:17:09 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1USQMK-0001I9-HB for ding@lists.math.uh.edu; Wed, 17 Apr 2013 06:17:06 -0500 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1USQMI-0007CZ-Ok for ding@gnus.org; Wed, 17 Apr 2013 13:17:02 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id E89701A84EF for ; Wed, 17 Apr 2013 13:17:02 +0200 (CEST) X-Virus-Scanned: amavisd-new at uni-koblenz.de Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G7V-MIsiFjMK for ; Wed, 17 Apr 2013 13:17:02 +0200 (CEST) X-CHKRCPT: Envelopesender noch tsdh@gnu.org Original-Received: from thinkpad.tsdh.de (tsdh.uni-koblenz.de [141.26.67.142]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 153C41A84F0 for ; Wed, 17 Apr 2013 13:17:01 +0200 (CEST) Mail-Followup-To: ding@gnus.org User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) X-Spam-Score: -4.9 (----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:83078 Archived-At: Hi all, I'm reading quite a few high-traffic mailing lists, and my mailbox is shortly before running out of space. So I want to do some expiry. Basically, I could use total-expire, say, after 365 days, but I'd prefer if I could expire threads I'm not interested in much earlier than threads that are interesting to me. So now I'm trying to write a command that walks over all threads in the current summary and marks all threads that have a score lower than -30 and whose most recent article is older than 60 days as expirable. That's what I came up with so far. --8<---------------cut here---------------start------------->8--- (defun th-gnus-summary-exprire-old-lowscore-articles () (interactive) (goto-char (point-min)) (dolist (thread gnus-newsgroup-threads) (let ((score (gnus-thread-total-score thread)) (age (/ (- (gnus-float-time (current-time)) (gnus-thread-latest-date thread)) 60 ;; minutes 60 ;; hours 24 ;; days ))) (message "Thread %s has score %s and is %s days old." (aref (car thread) 1) score age) ;; (when (and (> age 60) ;; (< score -30)) ;; (dolist (article thread) ;; (gnus-summary-mark-article (aref article 0) gnus-expirable-mark= ))) ))) --8<---------------cut here---------------end--------------->8--- The problem is that in some summary buffers, I get an error when I run it: --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (wrong-type-argument buffer-or-string-p 32) get-text-property(0 gnus-time 32) #[(header) "\303\304H\211.\305\232\203.=00\306\202%.\307\310\311 #\206%.= \312 !.\313\310\314\311\n %\210\n))!\207" [header d time gnus-float-time 3 = "" (0 0) get-text-property 0 gnus-time safe-date-to-time put-text-property = 1] 8]("Re: nREPL instance started by lein repl cannot be instrumented by jv= isualvm") mapcar(#[(header) "\303\304H\211.\305\232\203.=00\306\202%.\307\310\311 = #\206%.\312 !.\313\310\314\311\n %\210\n))!\207" [header d time gnus-float-= time 3 "" (0 0) get-text-property 0 gnus-time safe-date-to-time put-text-pr= operty 1] 8] ("Re: nREPL instance started by lein repl cannot be instrument= ed by jvisualvm" [578 "Re: nREPL instance started by lein repl cannot be in= strumented by jvisualvm" "Marko Topolnik " #("Fri= , 15 Feb 2013 01:21:32 -0800 (PST)" 0 1 (gnus-time (20765 65052))) "" "<9d494812-a424-459d-a282= -16393688e661@googlegroups.com> <7906BEE6-8D27-444B-B82D-87919AD1D5CD@zentrope.com> <86ed2273-3de5= -4c69-a467-ed7c02656579@googlegroups.com> <1A308C8B-00EF-4696-BAB9-F395FB0A= BE21@zentrope.com>" 11184 50 nil ((Cc . "\"leiningen@librelist.com\" ") (To . "leiningen@googlegroups.com"))] [579 "Re: nREPL= instance started by lein repl cannot be instrumented by jvisualvm" "Marko = Topolnik " #("Fri, 15 Feb 2013 05:23:26 -0800 (PS= T)" 0 1 (gnus-time (20766 14030))) "<02cc50a1-40dd-4f15-b30b-11be1beff8dd@g= ooglegroups.com>" "<9d494812-a424-459d-a282-16393688e661@googlegroups.com> = <7906BEE6-8D27-444B-B82= D-87919AD1D5CD@zentrope.com> <86ed2273-3de5-4c69-a467-ed7c02656579@googlegr= oups.com> <1A308C8B-00EF-4696-BAB9-F395FB0ABE21@zentrope.com>" 9416 27 nil = ((Cc . "\"leiningen@librelist.com\" ") (To . "lein= ingen@googlegroups.com"))])) gnus-thread-latest-date(("Re: nREPL instance started by lein repl cannot = be instrumented by jvisualvm" ([578 "Re: nREPL instance started by lein rep= l cannot be instrumented by jvisualvm" "Marko Topolnik " #("Fri, 15 Feb 2013 01:21:32 -0800 (PST)" 0 1 (gnus-time (20765 650= 52))) "" "<9d494812-= a424-459d-a282-16393688e661@googlegroups.com> <7906BEE6-8D27-444B-B82D-87919AD1D5CD@zentrope.com> = <86ed2273-3de5-4c69-a467-ed7c02656579@googlegroups.com> <1A308C8B-00EF-4696= -BAB9-F395FB0ABE21@zentrope.com>" 11184 50 nil ((Cc . "\"leiningen@librelis= t.com\" ") (To . "leiningen@googlegroups.com"))]) = ([579 "Re: nREPL instance started by lein repl cannot be instrumented by jv= isualvm" "Marko Topolnik " #("Fri, 15 Feb 2013 05= :23:26 -0800 (PST)" 0 1 (gnus-time (20766 14030))) "<02cc50a1-40dd-4f15-b30= b-11be1beff8dd@googlegroups.com>" "<9d494812-a424-459d-a282-16393688e661@go= oglegroups.com> <7906BE= E6-8D27-444B-B82D-87919AD1D5CD@zentrope.com> <86ed2273-3de5-4c69-a467-ed7c0= 2656579@googlegroups.com> <1A308C8B-00EF-4696-BAB9-F395FB0ABE21@zentrope.co= m>" 9416 27 nil ((Cc . "\"leiningen@librelist.com\" ") (To . "leiningen@googlegroups.com"))]))) (- (gnus-float-time (current-time)) (gnus-thread-latest-date thread)) (/ (- (gnus-float-time (current-time)) (gnus-thread-latest-date thread)) = 60 60 24) (let ((score (gnus-thread-total-score thread)) (age (/ (- (gnus-float-tim= e (current-time)) (gnus-thread-latest-date thread)) 60 60 24))) (message "T= hread %s has score %s and is %s days old." (aref (car thread) 1) score age)) (while --dolist-tail-- (setq thread (car --dolist-tail--)) (let ((score (= gnus-thread-total-score thread)) (age (/ (- (gnus-float-time (current-time)= ) (gnus-thread-latest-date thread)) 60 60 24))) (message "Thread %s has sco= re %s and is %s days old." (aref (car thread) 1) score age)) (setq --dolist= -tail-- (cdr --dolist-tail--))) (let ((--dolist-tail-- gnus-newsgroup-threads) thread) (while --dolist-ta= il-- (setq thread (car --dolist-tail--)) (let ((score (gnus-thread-total-sc= ore thread)) (age (/ (- (gnus-float-time ...) (gnus-thread-latest-date thre= ad)) 60 60 24))) (message "Thread %s has score %s and is %s days old." (are= f (car thread) 1) score age)) (setq --dolist-tail-- (cdr --dolist-tail--)))) (catch (quote --cl-block-nil--) (let ((--dolist-tail-- gnus-newsgroup-thr= eads) thread) (while --dolist-tail-- (setq thread (car --dolist-tail--)) (l= et ((score (gnus-thread-total-score thread)) (age (/ (- ... ...) 60 60 24))= ) (message "Thread %s has score %s and is %s days old." (aref (car thread) = 1) score age)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (cl--block-wrapper (catch (quote --cl-block-nil--) (let ((--dolist-tail--= gnus-newsgroup-threads) thread) (while --dolist-tail-- (setq thread (car -= -dolist-tail--)) (let ((score (gnus-thread-total-score thread)) (age (/ ...= 60 60 24))) (message "Thread %s has score %s and is %s days old." (aref (c= ar thread) 1) score age)) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (cl-block nil (let ((--dolist-tail-- gnus-newsgroup-threads) thread) (whi= le --dolist-tail-- (setq thread (car --dolist-tail--)) (let ((score (gnus-t= hread-total-score thread)) (age (/ (- ... ...) 60 60 24))) (message "Thread= %s has score %s and is %s days old." (aref (car thread) 1) score age)) (se= tq --dolist-tail-- (cdr --dolist-tail--))))) (dolist (thread gnus-newsgroup-threads) (let ((score (gnus-thread-total-s= core thread)) (age (/ (- (gnus-float-time (current-time)) (gnus-thread-late= st-date thread)) 60 60 24))) (message "Thread %s has score %s and is %s day= s old." (aref (car thread) 1) score age))) th-gnus-summary-exprire-old-lowscore-articles() call-interactively(th-gnus-summary-exprire-old-lowscore-articles record n= il) command-execute(th-gnus-summary-exprire-old-lowscore-articles record) execute-extended-command(nil "th-gnus-summary-exprire-old-lowscore-articl= es") call-interactively(execute-extended-command nil nil) command-execute(execute-extended-command) --8<---------------cut here---------------end--------------->8--- This seems to happen when there's an incomplete thread. At least the command doesn't error after I've referred the complete thread using A T. On the other hand, when I open a summary of another group where also incomplete threads are shown, I don't get that error. Hm, it seems that it's caused by the thread having a false root. That is, the error appears when the thread looks like --8<---------------cut here---------------start------------->8--- O =E2=94=83 +=E2=94=83Marko Topolnik =E2=94=83 =E2=97=8B Re: nREPL = instance started... O =E2=94=83 +=E2=94=83Marko Topolnik =E2=94=83 =E2=95=B0=E2=94=80= =E2=9D=AF --8<---------------cut here---------------end--------------->8--- but when I hit ^ and it becomes --8<---------------cut here---------------start------------->8--- R =E2=94=83 =E2=94=83Keith Irwin =E2=94=83 =E2=97=8F Re: nREPL = instance started... R =E2=94=83 +=E2=94=83Marko Topolnik =E2=94=83 =E2=94=9C=E2=94=80= =E2=9D=AF O =E2=94=83 +=E2=94=83Marko Topolnik =E2=94=83 =E2=95=B0=E2=94=80= =E2=9D=AF --8<---------------cut here---------------end--------------->8--- my command works without any error. How can I fix this? I mean, I obviously want to run my command in complete summary containing all articles I've ever received in that group. Of course, chances are high that the group contains incomplete threads with false roots where ^ (gnus-summary-refer-parent-article) won't cure the symptoms. Bye, Tassilo