From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#36341: 27.0.50; Reading from the Gnus dribble file leaves data inconsistent Date: Mon, 08 Jul 2019 10:29:17 -0700 Message-ID: <878st8zb82.fsf@ericabrahamsen.net> References: <87v9wwuxge.fsf@ericabrahamsen.net> <87mui8kvkw.fsf@aia00054aia.gr> <87fto0tae3.fsf@ericabrahamsen.net> <874l49s5qt.fsf@ericabrahamsen.net> <87wogykike.fsf@ericabrahamsen.net> <87tvc0e13t.fsf@ericabrahamsen.net> <87sgrhz9e3.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="62275"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 36341@debbugs.gnu.org, Deus Max To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 08 19:30:48 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkXTT-000G5C-Ik for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jul 2019 19:30:47 +0200 Original-Received: from localhost ([::1]:43520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkXTR-0008Uy-Oc for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jul 2019 13:30:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34761) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkXT2-0008R1-2T for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 13:30:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkXSt-0001DE-IE for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 13:30:13 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50600) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkXSk-000197-Mo for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 13:30:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkXSk-0004lO-FT for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 13:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Jul 2019 17:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36341 X-GNU-PR-Package: emacs Original-Received: via spool by 36341-submit@debbugs.gnu.org id=B36341.156260697318249 (code B ref 36341); Mon, 08 Jul 2019 17:30:02 +0000 Original-Received: (at 36341) by debbugs.gnu.org; 8 Jul 2019 17:29:33 +0000 Original-Received: from localhost ([127.0.0.1]:59421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkXSG-0004kH-Vp for submit@debbugs.gnu.org; Mon, 08 Jul 2019 13:29:33 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:44962 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkXSD-0004k3-AL for 36341@debbugs.gnu.org; Mon, 08 Jul 2019 13:29:30 -0400 Original-Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 1113EFA02D; Mon, 8 Jul 2019 17:29:18 +0000 (UTC) In-Reply-To: (Lars Ingebrigtsen's message of "Mon, 08 Jul 2019 18:22:12 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:162345 Archived-At: On 07/08/19 18:22 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen writes: > >> I think `gnus-group-set-info' is the only place that happens, so it >> isn't too terrible to just explicitly set both hashtable and alist in >> that function. I've attached the commit that does that. > > Sounds good -- please apply. Cool, will do. >> My plan for avoiding this class of errors in the future is to change the >> representation of Gnus groups from lists to EIEIO objects. Then >> `gnus-newsrc-alist' would merely be a disk serialization format, and the >> hashtable would be the source of authority. That would also make the >> "dummy.group" unnecessary. But let's see if I get there, and if the >> changes are accepted... > > The whole point of that awkward structure is to allow > inserting/removing/updating groups from the list-of-subscribed-groups as > an O(1) operation. Updating is still fine as O(1) with just a hash > table, but without the point-at-the-previous-element list, you can't > remove the elements, or add new elements before the group, as an O(1) > thing. Okay, I get that. But I wonder how important it is that add/delete operations be so efficient? Does subscription/unsubscription happen so often that it needs to be fast? As for sorting, in current master code sort-order is kept in `gnus-group-list' (when topic mode is off) and `gnus-topic-alist' (when it's on), so we're already sorting using plain lists of strings. In fact, right at the moment, there's already no need for the ordering in `gnus-newsrc-alist'. All of the "(while (setq info (pop newsrc))" loops could be replaced right now with "(dolist (g gnus-group-list) (setq group (gnus-get-info g))" Eric