From unknown Thu Jun 19 14:04:42 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#60531 <60531@debbugs.gnu.org> To: bug#60531 <60531@debbugs.gnu.org> Subject: Status: 29.0.50; Some fixes and suggestions for the docstrings of treesit-parent-while and treesit-parent-until Reply-To: bug#60531 <60531@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:04:42 +0000 retitle 60531 29.0.50; Some fixes and suggestions for the docstrings of tre= esit-parent-while and treesit-parent-until reassign 60531 emacs submitter 60531 Daniel Mart=C3=ADn severity 60531 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 03 17:45:51 2023 Received: (at submit) by debbugs.gnu.org; 3 Jan 2023 22:45:51 +0000 Received: from localhost ([127.0.0.1]:47025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCq2Z-0004UY-E9 for submit@debbugs.gnu.org; Tue, 03 Jan 2023 17:45:51 -0500 Received: from lists.gnu.org ([209.51.188.17]:56050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCq2V-0004Ms-Pi for submit@debbugs.gnu.org; Tue, 03 Jan 2023 17:45:50 -0500 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 1pCq2U-0001Z8-LM for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 17:45:47 -0500 Received: from sonic309-25.consmr.mail.ir2.yahoo.com ([77.238.179.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pCq2R-0002e0-AR for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 17:45:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1672785940; bh=E4MZX5exwXJBDk1pZRxa5XDvX1HvyPHFxN2r5+GG9bY=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=bLumCOc2C+iGIQkDk6M4E2UnN0j82vNINobqLlEXzEk20jIfmn38onf2HdNDBbUh4GKkUuC7BJ9VsillcWW++Ln7iL0Jk7dyjCIrXqz6zbJrEm6cZz7RqOgnhCIAWvwDycvlf9In0OhPv0XvUd4JmC15qJ8fAyH4oncK7pa72HHOvvMpYjcTBwIiZKeFMRD2srSweyFWE1Gx9MKkbPvtLLbnHElSD9m8z9O7JvLe9UFKvWslVo+nz9AxmHbLsZFapk4F/61qHkpcVeC8MRM2cSjKk6dB6gOVLjOdcIi5WsqFHGWmnf899yI3oJ/M4PIBV0CcExTM8vkuPSIiJQEHmg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1672785940; bh=8BGm8CVvP8y/f4rGnYcDxwhH+dCQEBuJNw+f4p4jpXG=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=e1tBLS4JzBszYFyLRTvH5KsmnsAS0zN+HAWTR/6jlJ0WVWX7FLJekLWIs319Vr1U5p8j4/oaE4CxFtKPd/kPLpkAjjdYWteVgoTwLDRqwuOlaHlVGHo+T3mmLXGLCPD34QPLeNbZZ8fQ/bg7rXDpcsic5Ldj5DyFXjJZu7AkbfFV1aKiqwEcrU9rwnuRU2ruW0XnOShX6dFRNwssiokTHbU+uhtDHowrNao71BvRmOhIWDHKIojttvEBFs/08fQX3VKyaqWx3W60fxKPe7j0PTkx5ij1UYngKUnsUHdyh0mNXc49c4rvqd6RyUgeEa9SQ49E8beNhIJUW6av7Aow3g== X-YMail-OSG: uNvs51oVM1kl5sRhyO__XHnJuEqB0mtonfD9eaya0jq.nWeUwY4w3myMEL5q82H PgO8uUu7Wgu19GWSHMfx0mYJi5oBQt5sLnUpW2bxNMP65x7Zc7x5PaRJuhqN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1Yra1_NNsxdd2fi 2UFdaY0F55uAw6lo0.RswzYl4v80- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ir2.yahoo.com with HTTP; Tue, 3 Jan 2023 22:45:40 +0000 Received: by hermes--production-ir2-5795fc58c8-6lscn (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 8533d495f6c9ff5c8eca07d22e8dd9b0; Tue, 03 Jan 2023 22:45:36 +0000 (UTC) From: =?utf-8?Q?Daniel_Mart=C3=ADn?= To: bug-gnu-emacs@gnu.org Subject: 29.0.50; Some fixes and suggestions for the docstrings of treesit-parent-while and treesit-parent-until Date: Tue, 03 Jan 2023 23:45:35 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain References: X-Mailer: WebService/1.1.20982 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 826 Received-SPF: pass client-ip=77.238.179.83; envelope-from=mardani29@yahoo.es; helo=sonic309-25.consmr.mail.ir2.yahoo.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) The docstring of treesit-parent-while says: Return the furthest parent of NODE that satisfies PRED. Return nil if none was found. PRED should be a function that takes one argument, the parent node. But, according to the source code, the first invocation of NODE passes NODE itself, not its parent: (let ((last nil)) (while (and node (funcall pred node)) The same happens with the docstring of treesit-parent-until. Another suggestion I have is that "the furthest parent of NODE" is a bit ambiguous (furthest from NODE or from the root?). I think it would be more clear to say it will return the highest (ie. least deep) *ancestor* of NODE. In 37.3 Retrieving Nodes, we introduce the concepts of "higher" and "lower" when explaining Tree-sitter nodes, so using this terminology consistently would avoid confusion. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 05 02:35:12 2023 Received: (at 60531-done) by debbugs.gnu.org; 5 Jan 2023 07:35:12 +0000 Received: from localhost ([127.0.0.1]:50108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDKmO-0007Jl-9V for submit@debbugs.gnu.org; Thu, 05 Jan 2023 02:35:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDKmM-0007JZ-Nf for 60531-done@debbugs.gnu.org; Thu, 05 Jan 2023 02:35:11 -0500 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 1pDKmH-0006b5-2G; Thu, 05 Jan 2023 02:35:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=GaWfEdB5pXcUZ9p/7tP+48IZ3GsVLV92uvTYTLOe3xc=; b=TX8V3uA3e16Vu1s47TLV mGFi4LNsanbE4Bv7xp4TYGztsV71I4XaG4gmdFe8sVPMOCawolC6SKwbluImiVNAwuEc5bbAPdJRP arAYwwfPlbDYqawnp2mL4V9n1ARknlvjqHkrWPDlmcn04lE6M87SjdUtyH1hikHkWN1dZu0evs8W0 06c33kdXqSLLF2MAQQJ+r3YGz7TRSHwAEF8Y/0RXYhOEKLyMtyIV6pAR9QWyMf6GcXCEJm9/b8BFi m0GXzQt/9Psgf0qkMmCVbpCPpQjRa7nNlEdadmFqHTStZICxWFcbpgRKr+VT37KhoFknQKcbTosp9 Xgkuw+SzKe+hRQ==; 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 1pDKmF-0001pB-3L; Thu, 05 Jan 2023 02:35:04 -0500 Date: Thu, 05 Jan 2023 09:35:17 +0200 Message-Id: <83eds9xwlm.fsf@gnu.org> From: Eli Zaretskii To: Daniel =?iso-8859-1?Q?Mart=EDn?= In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#60531: 29.0.50; Some fixes and suggestions for the docstrings of treesit-parent-while and treesit-parent-until References: MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60531-done Cc: 60531-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Tue, 03 Jan 2023 23:45:35 +0100 > From: Daniel Martín via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > The docstring of treesit-parent-while says: > > Return the furthest parent of NODE that satisfies PRED. > Return nil if none was found. PRED should be a function that > takes one argument, the parent node. > > But, according to the source code, the first invocation of NODE passes > NODE itself, not its parent: > > (let ((last nil)) > (while (and node (funcall pred node)) > > The same happens with the docstring of treesit-parent-until. This is clearly a case of unnecessary details. I made the doc string say just "node". > Another suggestion I have is that "the furthest parent of NODE" is a bit > ambiguous (furthest from NODE or from the root?). I think it would be > more clear to say it will return the highest (ie. least deep) *ancestor* > of NODE. In 37.3 Retrieving Nodes, we introduce the concepts of > "higher" and "lower" when explaining Tree-sitter nodes, so using this > terminology consistently would avoid confusion. Instead of changing a potentially confusing word to another potentially confusing word, I decided to describe in more detail what the functions do. From unknown Thu Jun 19 14:04:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 02 Feb 2023 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator