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#70579: 30.0.50; gnus: Wrong unread count in the Group buffer Date: Fri, 10 May 2024 16:31:12 +0530 Message-ID: <86pltux75z.fsf@outlook.com> References: <87ttjo7q98.fsf@outlook.com> <87sez83foa.fsf@ericabrahamsen.net> <864jb78nbd.fsf@gnu.org> <87ttjo7q98.fsf@outlook.com> <87sez83foa.fsf@ericabrahamsen.net> <864jb78nbd.fsf@gnu.org> <87wmo2qptg.fsf@ericabrahamsen.net> <87ttjo7q98.fsf@outlook.com> <87sez83foa.fsf@ericabrahamsen.net> <864jb78nbd.fsf@gnu.org> <87wmo2qptg.fsf@ericabrahamsen.net> <87seyqqp5w.fsf@ericabrahamsen.net> <87wmo2qptg.fsf@ericabrahamsen.net> Reply-To: James Thomas Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14775"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eric Abrahamsen , Eli Zaretskii To: 70579@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 10 13:02:34 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 1s5O1J-0003fI-IO for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 May 2024 13:02:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5O17-0003Zo-K5; Fri, 10 May 2024 07:02:21 -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 1s5O0r-0003KM-Ds for bug-gnu-emacs@gnu.org; Fri, 10 May 2024 07:02:17 -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 1s5O0q-00059I-DV for bug-gnu-emacs@gnu.org; Fri, 10 May 2024 07:02:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s5O0o-0005Kg-HF for bug-gnu-emacs@gnu.org; Fri, 10 May 2024 07:02: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: Fri, 10 May 2024 11:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70579 X-GNU-PR-Package: emacs Original-Received: via spool by 70579-submit@debbugs.gnu.org id=B70579.171533889420489 (code B ref 70579); Fri, 10 May 2024 11:02:02 +0000 Original-Received: (at 70579) by debbugs.gnu.org; 10 May 2024 11:01:34 +0000 Original-Received: from localhost ([127.0.0.1]:42008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5O0M-0005KP-1f for submit@debbugs.gnu.org; Fri, 10 May 2024 07:01:34 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:35293) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5O0K-0005KF-5P for 70579@debbugs.gnu.org; Fri, 10 May 2024 07:01:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1715338878; x=1715943678; i=jimjoe@gmx.net; bh=D/RGQ8b1fDq9KUkcihptAP2I6eGvKAkOuRARGDfuu0M=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=jxOOsqxLuNeenLD89TR0f6UWMoASH423Yp00fJosghx8xzRKY6Aol+PVuSed2rNO K/uJ3R0DU4jtyxQgwgkIG/Oz4/w/jkN/IZ1H8tsM7uyVBaZS9o1eZJgXsSKc7m/+G 16CyOE6EOhFligxCPSDQ4L3jenwGvxHEzRtqhIJ0/11FZGNTqT8g0W/Q9scoCYYfD 8jUVSRKSU0aEK1AoQOxrkQssUm+ce5mH6UFA1QojejQseXit5eZLCOja2e5xf1Gws Hkt2fSSZCOO1ptqNCzFLyxvPbvQdjxwAwe+DYwgj0gwLtd/ht17NoUSgNaD7VCXgu Axqpz71UyVZifjtRuQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from user-Inspiron-3493 ([117.242.196.229]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1Mgeo8-1sWiWn0rBU-00e4J4; Fri, 10 May 2024 13:01:18 +0200 In-Reply-To: <87wmo2qptg.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 09 May 2024 21:00:11 -0700, Thu, 09 May 2024 21:14:19 -0700, Thu, 09 May 2024 23:23:37 -0700") X-Provags-ID: V03:K1:vMF4xUE9Lv5gxWdJoZ+3oWbYlI4HiQjcMNemiE5SwjEsQzU6ESA AIQ2Nt/Y+BQzMeEoWGS+5BoEUSVAzBYZBAPqeuqMYc4RNiEfF11dmqbKsNtbvL98TcLYj1s iq4GN63sn+ZWQBzkUjUNuLRlk2Of9c8Xvdlq7zp4pc7mFVrkq2Zgd2ZXNz834eLsdB2Ltrc kMTpu5ntxdhPe9uRJO1Nw== UI-OutboundReport: notjunk:1;M01:P0:Kzu/rGx2o4s=;78Dlen8fXM71SjwgDioOGwJrCoA 9hiaUoAf0qYf7thxbmxvzlBIu8QBl8JKzuUWrHDuV22s2CmSC30pdFu42T09nEWAeHC6t3L7x xL6hLh18paF7vD40mHdCkPpPUzlC5QxOd/ezitUquJvw9eqGORnQU7uj+4Lb4C0R1C+NnrpaE GJrDAikD5xfLFKKQTEKEEd6jRH+ei8Rcm4VsvIHsLokkrZFFZoBKfbA7jMPIowqR5IyjgFQBg 699Yb5XNsf0+NOOk6PADLqBc+Ou+I1ZUsZtruoZLT8pZXqPRgzLFhkZn6lEBRhaJe4q1Tou6d sd/6xcOTEul+w6TGOydn4clk8n3HUg/ORY3F8Lm/VAJjEpevjUVdFcjhot4jMGO4B6Pot6nzu R1ddND4Zq5TAMKJ71Z7l5g4Ne/cDX+2D+AhEDizW134DV+I2m9pPq0g4WZNMxkCH0/zl8EW5B jmVt3Unaidf/601tLvZ2BUomMp2pMHCjZsmtvbIUUKARXmjBqdDgecpSwDHgXQyce3pQhZ2Mr YxsXmqkRn7bJPzGy8FWcJ0hLYN48IP7l+B2QdVqRb+zID50NcT3tR+kLwEGWonnM1NfsqUkkL 6nKB0NAdB+1Z9LJo0Ik4h4wAhu45DId7FsrZGb40o5pnvWLXP1gFaVByFEXdzoeWA4v/nL7IV PlRSpbTGYU0F6/jS+3ZGR14/nGOE4Z64RZpTP7LrFD2+gsJd2HvTjHatWIZpluYzOBktpuVp3 wdf7GIex2nkAWLvHI5sMmBWhFKbGJ0CLfOswyxCgiRyFSu2S21FPBxCQEyIcmgenDb+fM3/B 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:284811 Archived-At: Eric Abrahamsen wrote: > Eli Zaretskii writes: > >> Ping! Eric, can we make some progress here? >> >>> From: Eric Abrahamsen >>> Date: Thu, 25 Apr 2024 21:34:45 -0700 >>>=20 >>> James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of >>> text editors" writes: >>>=20 >>> > - (Preferably starting with an empty drafts folder) Compose a message >>> > and save it. >>> > - Open the drafts group, press e on the message and then kill the new >>> > buffer; then (incidentally, if you now do '/ N' then this bug does = not >>> > arise) delete the message (B DEL) >>> > - Press q >>> > - The message count is wrong (but can be corrected with M-g) >>> > >>> > cf. In gnus.general (gnus-summary-goto-article "87y192lr8f.fsf@gmx.ne= t") > > I've made some progress here -- the root of the problem seems to be > that, when we hit "e" in the draft summary buffer to resume editing a > draft, Gnus "jumps ahead" in message numbers. Basically what "editing" > actually means is that the old draft is deleted, and a new draft is > started, but the new draft has a article number that's the previous > draft's number + 2, and the "draft" group's active number is also > inflated (for instance (12 . 14) when it should be (12 . 13)). I was > also able to get it to jump three numbers in some cases. > > From this point, *any* normal usage will end up correcting the error: > using "C-c C-k" to kill the editing buffer (instead of "C-x k") or as > you noted any of the commands that lead to refreshing the unread count. > But if you don't use any of those commands, you'll see the inflated > active/unread count when you get back to the *Group* buffer (the "B DEL" > isn't necessary for the recipe, and in fact at that stage the message > under point has already been deleted). > > That's as far as I've gotten, and I'll keep working on why the article > number starts off inflated. But in the meantime, the solution is "don't > do that". Of course. I was only hoping that this would shed some light on the other unread-count problems.... IMO this is low-severity. > Sorry, that sounded a bit unfriendly, when I was the one who asked you > to submit the bug report! An hour or two of chasing Gnus function calls > will do that to you... A more-than-reasonable trade-off of expressiveness for the ultimate cause. =F0=9F=99=82 >>> I've made some progress here -- the root of the problem seems to be >>> that, when we hit "e" in the draft summary buffer to resume editing a >>> draft, Gnus "jumps ahead" in message numbers. Basically what "editing" >>> actually means is that the old draft is deleted, and a new draft is >>> started, but the new draft has a article number that's the previous >>> draft's number + 2, and the "draft" group's active number is also >>> inflated (for instance (12 . 14) when it should be (12 . 13)). I was >>> also able to get it to jump three numbers in some cases. >>> >>>>>>From this point, *any* normal usage will end up correcting the error: >>> using "C-c C-k" to kill the editing buffer (instead of "C-x k") or as >>> you noted any of the commands that lead to refreshing the unread count. >>> But if you don't use any of those commands, you'll see the inflated >>> active/unread count when you get back to the *Group* buffer (the "B DEL" >>> isn't necessary for the recipe, and in fact at that stage the message >>> under point has already been deleted). >>> >>> That's as far as I've gotten, and I'll keep working on why the article >>> number starts off inflated. But in the meantime, the solution is "don't >>> do that". >> >> Sorry, that sounded a bit unfriendly, when I was the one who asked you >> to submit the bug report! An hour or two of chasing Gnus function calls >> will do that to you... > > Okay, I found two things, one the proximate cause of this bug, another > "probably wrong" adjacent issue. > > The main problem is that `gnus-draft-setup' both calls `message-mode' > (which calls `message-set-auto-save-file-name'), and then directly calls > `message-set-auto-save-file-name' itself. Without getting into horrible > details, that functions shouldn't be called twice, because it generates > an extra numerical file name, which ends up inflating the active value > of the drafts group. > > I've attached a patch that removes the second call. If you feel > comfortable applying and testing patches, I hope you'll try it. In my > experiments it fixes the problem. > > The patch also semi-addresses the second issue. When saving a draft, > message-mode only buries the buffer, it doesn't delete it. If you go > back and start editing the draft, `gnus-draft-check-draft-articles' is > supposed to see if a there's already a buffer visiting the draft file, > and return you to that buffer instead of creating a new one. But it only > does that if the buffer is modified, which it isn't if you've > saved/buried the draft. > > I don't see why that should mean that you need a whole new buffer for > editing the message I can see a possible use case: you might want two versions of a draft message, one being a 'root' (or 'base') version. > , and the fact that there are now two "copies" of the > message buffer causes further problems with the inflating article > numbers (why I could sometimes see three or even four "jumps"). > > The patch removes the check for modification If my guess above is correct, this should be avoided. > Anyway, please let me know if you can check the patch. So I checked only the first hunk, and it worked, but seems to have caused another problem: If I now open the group and view an existing draft with RET, and then 'q', the message disappears - in both the count, and if the group is reopened. M-g reverts things back to normal. There's also a small hiccup with its working: 'B DEL' in the recipe above does not work (i.e. it's not deleted - is it related to it already being marked with 'G' at that point?), unless I 'q', re-enter and retry. Regards, James