From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#72949: Gnus sometimes reports new messages but not showing them on IMAP server Date: Tue, 17 Sep 2024 09:36:49 +0530 Message-ID: <86zfo69b52.fsf@gmx.net> References: <87h6g7mm8r.fsf@debian-hx90.lan> <87seu2xqpa.fsf@uwo.ca> <87frq2xh4c.fsf@uwo.ca> <86h6ah2q47.fsf@gmx.net> <87h6g7mm8r.fsf@debian-hx90.lan> <868qwar3yn.fsf@gmx.net> <86h6ankmm6.fsf@gmx.net> <87r09q1i0s.fsf@uwo.ca> <868qvx1xst.fsf@gmx.net> <861q1p1gg2.fsf@gmx.net> <87h6g7mm8r.fsf@debian-hx90.lan> <868qwar3yn.fsf@gmx.net> <86h6ankmm6.fsf@gmx.net> <87r09q1i0s.fsf@uwo.ca> <868qvx1xst.fsf@gmx.net> <861q1p1gg2.fsf@gmx.net> <87seu2xqpa.fsf@uwo.ca> <87frq2xh4c.fsf@uwo.ca> <871q1lw089.fsf@uwo.ca> <86plp4ovgj.fsf@gmx.net> <87cyl3u5vo.fsf_-_@uwo.ca> Reply-To: James Thomas Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38685"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: "72949@debbugs.gnu.org" <72949@debbugs.gnu.org> To: Dan Christensen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 17 06:08:14 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sqPVd-0009lC-OR for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Sep 2024 06:08:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqPVI-00045u-Bt; Tue, 17 Sep 2024 00:07:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqPVF-00045k-6i for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 00:07:49 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sqPVE-0002KY-Tb for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 00:07:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=+dGTmIPN++CLmUROMLqnqmSmjNzbkREYGOHu6Q9shiU=; b=bCJWH9kQE+5qwdMxILqJoc8DkYjEUqNi4D6HAA9FGXlw2gy8wOKcFGxNESqzhc2JmOwtiEMQgebgcQYRYLqCsEV/qp4B7rZNrzm7u1GfHgtrA2fhhSAAjpVBIItfj+Xx5ldwzMfdCOIVWvqlcv3fPJy+b4gdz+nMP36pBajYA3YeYr2nDF8M/B4xluDXQdxxj4nQSlPNxhAwV6cEHO0LZTmpDkPJpM6/D/tzMBMNhUMge9+hycGjHzLtoFJRKHj8Trs30wt8jtdgksgljo8dObJSsaJgQOdUVNMQuvkjd9bxTGH7obn0HnaOvXPPdVxwJw5mcMoRRt77Lgwbfwgeng==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sqPVS-0006qA-0G for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 00:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: James Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Sep 2024 04:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72949 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72949-submit@debbugs.gnu.org id=B72949.172654604826242 (code B ref 72949); Tue, 17 Sep 2024 04:08:01 +0000 Original-Received: (at 72949) by debbugs.gnu.org; 17 Sep 2024 04:07:28 +0000 Original-Received: from localhost ([127.0.0.1]:53708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqPUu-0006pC-5j for submit@debbugs.gnu.org; Tue, 17 Sep 2024 00:07:28 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:45083) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqPUs-0006ow-7h for 72949@debbugs.gnu.org; Tue, 17 Sep 2024 00:07:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1726546020; x=1727150820; i=jimjoe@gmx.net; bh=+dGTmIPN++CLmUROMLqnqmSmjNzbkREYGOHu6Q9shiU=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=f4Ls3A2bVTubV1m1IUn76aADAKThYZzhsvLuJWMkG+tZDur99PEHE/bwe2qnlpEK uHytISGKxLOc/6aUvp3POxuqQRG/iLjgctPijHsjkeui21IlJd5xGyGBXU51jX2uB LSMRXNbDWGCWIDU0jt1BDHYUkAIMcMQ/Bk7y4sFvcruavIFzAmaOXaI2vFAZ/I1RY LOlf7u3pbJQMCK4hJTO9ZUTs3hoSTEGtRc7R/Ezs24ze1z8gkdCpLb4+xvzln2cIe woP2P3bAdXiKs6U+t5P+V6sdwtfjx64G3ma3wPQXHSLK8W3eLoERDTcGRDZnl2plY 1GswczPK2XTcmIB+fg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from user-Inspiron-3493 ([117.206.138.10]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MaJ3t-1sVMUo0Njp-00OQeX; Tue, 17 Sep 2024 06:06:59 +0200 In-Reply-To: <87cyl3u5vo.fsf_-_@uwo.ca> (Dan Christensen's message of "Mon, 16 Sep 2024 12:42:38 +0000") X-Provags-ID: V03:K1:QdqRTRd4vAWbnZEqe0W8vYCIEp/YE8VVZrdud0CpK1E4yOLWsMp jHEzv8Aij9Eh4KFk4CDhZ4n64aGN5udxjko84QQGEnPZVHfAmN4699KHrpf87ov586ztgXT QV49v3YL4bq4o9YvE2D9u+79KH3noKQTMeeNVfxeCjeXPRlxZ6vAZP7mjXAXTYKryANnRlj 7hP5LbemNdFhFXaoO4+rw== UI-OutboundReport: notjunk:1;M01:P0:RY8WFQEPv3k=;KbHg2FdvuMksgbE2mdZzbt0e6zs CxvaT0RlDTPf+1m+8k6XdcUAnO98RxPPc+ZagJyYsOXliWUEG+4SqDeFHuRzWV8F+xWSvRuKx aaEFUcZI4wbfinLz5s2GqepKSRy87kejAP1ATgLKrEln5rQtay3UVaHilhCQoGK2JagZX2vz0 vfi+qJjDkWv4xyII8hF6L8dSWfm7JSiH1HlQgL173fvjAXVx0XkWN0uNPcodEmRC+0E9wSjor fd44x0jzvus0LdeqfyFgxOscVi1vclrZ5epZGJ9S7ZG6rDxS3gkQ5Eo6saCPVajiCfMBEbrwX /ormoxt7rT0QqhyahyNj6H85DRAZIzO3VUqMM/6qZC1TqX2s5S5u2XHSw1wCTzAHrnQJ4uzxJ dqO3EgthegrVjhTxVkYmPIGdXSJKa820zBOTXvtVwFg6ZBeqPcdKQr0hMSaoylY0J1/cViL/k mTlw4nwLes/yLZfrwR/kFE8Y7ViQuT+ovPvNCNiCkgVKwP2rCKgd7INuO2pqIh/Z7jqKDC2Ds t/BAAGEafifjHO7DalKuBrT1iIvMbxCH/LxpG6mMhdTtoSra5OTZOxSZPLzF9xPs0CKmXewsa oprJqIn4Bvms5AHdBCdF+W9RcY5Tl3LZy42IG6ZBmGwNwtbCRL5sFIphykzHgps3y671brT7U tV6SWhzZKGfDkIX5fNEapJuI6XcVlR6jpXEySAgFfdR0KqZdrAfJgRDV+kaCd5/EOWnou+I6f ROaEDkkX5E7hvmgjKAVz7+KFPnHJ9uEzTMZGQJmUSv/1QUBcazzkCSA+ORr0Ntsyx+4ueqTl X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291924 Archived-At: Dan Christensen wrote: > On Sep 16, 2024, James Thomas wrote: > >> Wait! I think we've miscommunicated: I'd meant the _other_ patch, the >> one in (gnus-summary-goto-article "<86zfoqpobd.fsf@gmx.net>"). I use >> that and it's working fine here. > > I believe you are talking about the patch to nnimap-request-group that > swaps the car and the cdr: > > (insert (format "211 %d %d %d %S\n" > (- (cdr active) (car active)) > - (car active) > (cdr active) > + (car active) > group)) > > After that patch, the relevant part of nnimap-request-group would look > like: > > (setq active (or active '(0 . 1))) > (erase-buffer) > (insert (format "211 %d %d %d %S\n" > (- (cdr active) (car active)) > (cdr active) > (car active) > group)) > > This code has two bugs that (mostly) cancel each other out. First, when > the group is empty, it represents that with the active range (0 . 1). > But that active range represents a group with two articles, numbered 0 > and 1. If you look throughout Gnus, the empty group is always > represented by the range (1 . 0). > > Second, this code has the car and the cdr in the wrong order. > Everywhere else in Gnus that creates a 211 line from an active > range puts the car before the cdr. In the case of an empty group, > these two bugs cancel. But if active already had a non-nil value, > then the car and the cdr would be wrong. And even if the active > range is always nil at this point, I don't approve of code that > has two bugs that cancel. > > After my proposed patch (attached again), the code looks like > > (setq active (or active '(1 . 0))) > (erase-buffer) > (insert (format "211 %d %d %d %S\n" > (max (1+ (- (cdr active) (car active))) 0) > (car active) > (cdr active) > group)) > > Now the active range is correctly set to (1 . 0) for an empty group. > This alone doesn't work, as the expression (- (cdr active) (car active)) > in the current code would then give a negative value for the number of > articles, which breaks at least one other place in Gnus. So we use > the calculation that nnml-request-group uses to get the correct number > of articles in the range (by adding 1), and also force negative values > to 0, just in case active contains some bogus data. > > I think this is the correct way to proceed, in line with how all > the other parts of Gnus create the 211 line. Thank you for the patient explanation! (I blame the confusion on the on and off attention I gave to this). Your patch LGTM. Regards, James