From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: rmail-total-messages has two different values, one is wrong Date: Sat, 01 Jul 2023 11:35:56 +0300 Message-ID: <83mt0gqb9v.fsf@gnu.org> References: <87mt0xexx8.fsf@autistici.org> <83ilbdyre8.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31347"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: andrea.monaco@autistici.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 01 10:36:05 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qFW5N-0007ve-2v for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Jul 2023 10:36:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFW4l-0002HE-Ro; Sat, 01 Jul 2023 04:35:27 -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 1qFW4k-0002Gy-6m for emacs-devel@gnu.org; Sat, 01 Jul 2023 04:35:26 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFW4i-0001KG-Qd; Sat, 01 Jul 2023 04:35:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=hmBd3GQC6dXIFFJeZaKVHqnwz1G+62E9MSQisreHqrA=; b=KbtKkKeDMUrn LVrAQJ3oYlv7UaWHyruGeAh6PYWvWPVwNkLzkI0hwAYsQ3LFsAbo5DugewWFnOxlTekORlxX5Z3mk f7+GkqALDhju3PhzXAXtzdJ7YENuyLOeNsmr1j135M88eRraet5Wa0NyFbDrtYEeGGMWrOwP1h3A0 ZMVu49wardUQRxGuRxSGiBO6avAWdyGFqkB00VHWCvyqBpuN4IJOG06nNgByTOK+NKdESHXnysYnm UOHsfk5uH5i6PQ7AQ9K8Q3nz9gyZYvaF2JiTRZUOoKCLaBG7HiS+Go6wEeI0mWbAA53+GU7h+bAa2 oclJU3fcDU3VcomY7XiqhA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFW4i-0000Yn-AO; Sat, 01 Jul 2023 04:35:24 -0400 In-Reply-To: <83ilbdyre8.fsf@gnu.org> (message from Eli Zaretskii on Sat, 24 Jun 2023 15:30:07 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:307324 Archived-At: > Date: Sat, 24 Jun 2023 15:30:07 +0300 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org > > > From: Andrea Monaco > > Cc: emacs-devel@gnu.org > > Date: Sun, 18 Jun 2023 14:51:15 +0200 > > > > > > I think the problem is in rmail-count-new-messages. The function runs > > in the main buffer, so this assignment > > > > > > (setq rmail-total-messages > > (+ rmail-total-messages total-messages)) > > > > > > should be duplicated for the summary buffer (maybe the same goes for > > other assignments in that function, I don't know). > > > > But this bug is not nasty, so we could just document the current > > behavior. What do you think? > > I think it's a bug: the value in the summary buffer should tell how > many messages are shown in the summary. > > Does the patch below give good results? Please try it both with > "normal" summaries and with various filtering alternatives. No further comments, so I've now installed the change on the master branch.