From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#65703: gnus-cut-thread loop condition oddity Date: Sat, 2 Sep 2023 16:24:38 +0200 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14358"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , Andrew G Cohen To: 65703@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 02 16:25:09 2023 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 1qcRYi-0003Yg-Pl for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Sep 2023 16:25:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcRYU-0008LV-AZ; Sat, 02 Sep 2023 10:24:54 -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 1qcRYT-0008LM-5d for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 10:24:53 -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 1qcRYS-0003wa-Tm for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 10:24:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qcRYc-00015I-LN for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 10:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Sep 2023 14:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65703 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Emacs Bug Report Original-Received: via spool by submit@debbugs.gnu.org id=B.16936647014156 (code B ref -1); Sat, 02 Sep 2023 14:25:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Sep 2023 14:25:01 +0000 Original-Received: from localhost ([127.0.0.1]:38233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcRYb-00014x-3s for submit@debbugs.gnu.org; Sat, 02 Sep 2023 10:25:01 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:43446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcRYZ-00014l-C2 for submit@debbugs.gnu.org; Sat, 02 Sep 2023 10:24:59 -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 1qcRYK-00088A-9R for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 10:24:44 -0400 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qcRYI-0003vV-4Z for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 10:24:44 -0400 Original-Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-50091b91a83so82595e87.3 for ; Sat, 02 Sep 2023 07:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693664680; x=1694269480; darn=gnu.org; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=OAGl5kL4uZQ3RFEbZXE+frs6FLhb70E2/C0iclsyGMU=; b=cSQzcwP9F382dlv2DfDXP8EFboKmHhzpa0UTzDyQbK2whjgrRj9+OkYeBmiKNgdaU3 2gK973vMVKWnZpjIMl8MHjonfkGn8lira+aBGrbASm75yG/YvObJHOH7AgpiGIHkR0tN hQD1v5wspXA4k2LZev8pV3Nu8PXvwTclnaO1yykIWuPA1Xcog/PmpKryTYqyYaBw5nb3 dms9icph75e3uh45KEbAbLDNvoyrXV9u/0Xw/3tmbvP2wUMEwkDT5uqGLh4ASvMR+YGZ tpYfkbvh6xe8dYA/Sp24owVgve8lf6Mah3EGiFZe1mjagLkGD8kKevs29rEh/ju72tHd IhKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693664680; x=1694269480; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OAGl5kL4uZQ3RFEbZXE+frs6FLhb70E2/C0iclsyGMU=; b=Ah7rxu0mzSF4Tg+34WylRRzd+sgGeoYXW4JLpqmjfrNjvgaegap+hvKIkFtRqH6I8f WHnnHNlrD77IQHVdlEB5YTgGXmPxmzIv6Atn9Qy3j8GgiIna9ovZx0Ahvq9y41EG5O6j RiavIf7NzuIEdPNIZwIt8VSwCZed4lMHcjQozz6hJZx8lKZNObB83weN2vA2te0BmTSO ih1Xjc4oPGwwCNytlcj8e/vYq0Psut0nFIXi4JZNSWW5lkmCIM3ltpzt/3AqXdoXof5Y 99SSYURI4on1yv6p00hkTMiCiDseBy9DSzefza4sd0l1wnjzptk3h257O5SPqzwGgSkq 13pw== X-Gm-Message-State: AOJu0Yx3VP2KGFnEfxAGtz40TnYIKrsp9A8I2pDVLfq4T4b5SjyI9Bi0 sYP6drlDFILKb4pWVZoZRcXau04HQ+g= X-Google-Smtp-Source: AGHT+IHZa4HcoxOmT5Xz5C5VBy9ci1sXzE/DNOMy927J0dmBGtWZg6XMYS5uAGbQcYoaHasSZiKiPw== X-Received: by 2002:a19:4315:0:b0:500:c010:2540 with SMTP id q21-20020a194315000000b00500c0102540mr2981605lfa.58.1693664679497; Sat, 02 Sep 2023 07:24:39 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id q28-20020ac2511c000000b004ff8ee47f2fsm991820lfb.1.2023.09.02.07.24.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Sep 2023 07:24:39 -0700 (PDT) X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=mattias.engdegard@gmail.com; helo=mail-lf1-x135.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:269003 Archived-At: This is about code I know nothing about but a tool of mine noticed it in = the passing: The loop in gnus-cut-thread in lisp/gnus/gnus-sum.el, replicated below, = has a very odd loop condition: the latter half looks misplaced, as if it = would belong in the loop body. In particular, there is a definite possibility that the little `while` = loop at the end will end up supplying the value for the loop condition = of the outer loop, which of course terminates it since `while` forms are = always nil. Maybe someone who knows Gnus please take a look? (while (and thread (or (gnus-summary-article-sparse-p (mail-header-number (car = thread))) (gnus-summary-article-ancient-p (mail-header-number (car thread)))) (if (or (<=3D (length (cdr thread)) 1) ; Should this = be here? (eq gnus-fetch-old-headers 'invisible)) (setq gnus-newsgroup-limit (delq (mail-header-number (car thread)) gnus-newsgroup-limit) thread (cadr thread)) (when (gnus-invisible-cut-children (cdr thread)) (let ((th (cdr thread))) (while th ; And this? (if (memq (mail-header-number (caar th)) gnus-newsgroup-limit) (setq thread (car th) th nil) (setq th (cdr th))))))))))