From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/87541 Path: news.gmane.org!.POSTED!not-for-mail From: Andrew Cohen Newsgroups: gmane.emacs.gnus.general Subject: mangled marks and nnselect Date: Sat, 06 May 2017 21:59:41 +0800 Organization: Boston University Message-ID: <87inleozle.fsf@hanan> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1494079330 11409 195.159.176.226 (6 May 2017 14:02:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 6 May 2017 14:02:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: ding@gnus.org Original-X-From: ding-owner+m35756@lists.math.uh.edu Sat May 06 16:02:07 2017 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from mxfilter-048034.atla03.us.yomura.com ([107.189.48.34]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d70He-0002sL-Th for ding-account@gmane.org; Sat, 06 May 2017 16:02:07 +0200 X-Yomura-MXScrub: 1.0 Original-Received: from lists1.math.uh.edu (unknown [129.7.128.208]) by mxfilter-048034.atla03.us.yomura.com (Halon) with ESMTPS id 98448321-3264-11e7-8ed1-b499baa2b07a; Sat, 06 May 2017 14:02:10 +0000 (UTC) Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.87) (envelope-from ) id 1d70Gm-0006MN-CA; Sat, 06 May 2017 09:01:12 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1d70Gi-0006LZ-5v for ding@lists.math.uh.edu; Sat, 06 May 2017 09:01:08 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.87) (envelope-from ) id 1d70Gg-0001FT-Tn for ding@lists.math.uh.edu; Sat, 06 May 2017 09:01:07 -0500 Original-Received: from [195.159.176.226] (helo=blaine.gmane.org) by quimby.gnus.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1d70Gf-0005OA-Gm for ding@gnus.org; Sat, 06 May 2017 16:01:05 +0200 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1d70GX-0001gY-Qu for ding@gnus.org; Sat, 06 May 2017 16:00:57 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 64 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:+l3dN4WZq4Nq/PMPSMAg8tTITDY= List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:87541 Archived-At: For anyone who has been testing the feature/gnus-nnselect branch (probably this means only Eric:)) I have spent the evening tracking down an unfortunate bug in storing marks in originating groups when exiting from an nnselect group. I made two errors in the code that resulted in some harmless but annoying cruft entering the .newsrc.eld file: 1. I was putting article numbers in the 'seen list that weren't part of the actual group (that is, the seen list was correct but had extra numbers that didn't correspond to any real articles). This is harmless (as far as I can tell---its been happening to me for quite awhile with no ill effects) but annoying. I've fixed it now, but removing the extraneous info has to be done 'by hand' (and by that I mean it can be done in lisp, but it won't happen automatically with continued use of gnus). 2. I wasn't properly compressing the 'unexist list. Again this is totally harmless except that the uncompressed lists can take up a significant amount of disk space if you have groups with large numbers of article numbers in play (which is the case if you have been using an imap group for many years, for example). My .newsrc.eld decreased in size by a factor of 2 (from 2 MB to 1 MB). Again this won't fix itself, but can be fixed with a bit of lisp. Here is what I used to fix it. 1. Make a back-up copy of .newsrc.eld 2. Make sure that gnus is running (so that the .newsrc.eld is loaded by gnus). 3. Execute the following code for each server that might be screwed up (replace server with the name of the server, e.g. "nnimap:foo") 4. Quit from gnus. 5. Check that this didn't destroy your .newsrc.eld. If it did, put the copy into place to restore all the marks. ;; make a list of groups on the server (setq my-groups (nnir-get-srv server)) ;; compress unexist (dolist (group my-groups) (let* ((marks (gnus-info-marks (gnus-get-info group))) (unexist (gnus-uncompress-sequence (alist-get 'unexist marks)))) (when (and marks unexist) (setf (cdr (assoc 'unexist marks)) (gnus-compress-sequence unexist))))) ;; remove extraneous articles from seen list (dolist (group my-groups) (let* ((marks (gnus-info-marks (gnus-get-info group))) (seen (gnus-uncompress-sequence (alist-get 'seen marks))) (active (cdr (gnus-active group)))) (when (and active seen (> (car-safe (last seen)) active)) (let (my-list) (cl-every #'(lambda (num) (and (>= active num) (push num my-list))) seen) (setf (cdr (assoc 'seen marks)) (gnus-compress-sequence (nreverse my-list)))))))