From debbugs-submit-bounces@debbugs.gnu.org Tue May 20 00:29:20 2025 Received: (at submit) by debbugs.gnu.org; 20 May 2025 04:29:20 +0000 Received: from localhost ([127.0.0.1]:51120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uHEbP-0000hO-7t for submit@debbugs.gnu.org; Tue, 20 May 2025 00:29:19 -0400 Received: from lists.gnu.org ([2001:470:142::17]:60380) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uH8ha-0002R1-09 for submit@debbugs.gnu.org; Mon, 19 May 2025 18:11:18 -0400 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 1uH8hU-0006Xq-A5 for bug-gnu-emacs@gnu.org; Mon, 19 May 2025 18:11:12 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uH8hS-0002aD-Ds for bug-gnu-emacs@gnu.org; Mon, 19 May 2025 18:11:11 -0400 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-6000f2f217dso4431055a12.1 for ; Mon, 19 May 2025 15:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747692667; x=1748297467; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=FzW4R3F38uoD0WXILpL6jMYbnkbZRSPY3dU+gaSb2Sg=; b=JwrLsjaqDTr+Lj/DU+FFgCpkcPnkywOuFucEIF8/8aIXjEwzltOKiZA6VjPt88QnGY b5R1v0VDjkG2M9ltdJYJkvPYTOURmAblvSTsNW+UtI+xYreQ0o7SYGUsRpZmeTf1fPxU u9F1xkFgn8XpWhqcjpB/1cBZzXOvFVhxIO/QrzsoeRjHicYa4NvjX5uszcroVQMbLju6 WSORz9Lgvdke8cIchUsevUFdq5duluTHeSkJt0r/kNZr6ewXP5BMCiTcaON5XyYyID+C 75WzOsA63NjIFpOtMYrXAULW6XENdxYcNdzJo/G539QCceETx6dOxZLKrEMunoi9vB0m hbog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747692667; x=1748297467; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FzW4R3F38uoD0WXILpL6jMYbnkbZRSPY3dU+gaSb2Sg=; b=uyzFeZpswAaT0teYFAdWD1S4iLtzeBckKgny6nr86Ayo3XJlB/CA9BqWBm1ZxQIVVC DHYF2ERtdGAJaXlSQMIDnukhBn3YwHVytg+4cRqp++1wELA78wy7BXbgyD3Cq9JSH9aY CEVzXXU3Lf0K3nHBchWlpdwPRpzZTAvNpwwvmJjZsqZcnPmy3GsADu1meBZ0Z+Jbzfk+ smj1lMRrclSmMRoHRRF4kTsR1icG81IQ71UC3++0Y3Nzn8kmbMqr6vT72QduuBX0yahQ Y+4opld3RF+OViIBWuph8Sup6sBUlogj2Kx9+FmZo0c3i8XtlvLh9qLPuhINHDjUZ+xX U1hg== X-Gm-Message-State: AOJu0Yxy03cjXuy8Nf4Cnlamr90e8Gg+8K0Rwmtm4jFH7ucjq+4AeLRX EUsM0bQf0mBzFGfCW0k9D9aM2YTx419cvBgRYwExaeYl5DA54RZ8GJGHJT2CGQ== X-Gm-Gg: ASbGncuZyCrsictluPIrep1PLiv+daCkhSy+aZ1tj9ihY55PJAtyNFn+Ek/aXfPys23 cq+n+yz4TV7FivT+z5Wf7fPwFCuapCGdZfHbyi4GPZzES8OdbmDBzssV7eAz1+ZqAwXndOtZ59F ARBLGHzFFUftjQPulm5DebaM9/3us3g4Lan6fURA9ub/wImYnlJdQa8g7LlzL9oDr2dhRIlgaQF xonfxzcimUYSGrFHLCl/ZKM4waNhnahBfYDdPf7oQPP3+8MGS3HIBjR/nYvmYNEi7/XJol5kwOP gbl1BGzNkKQkMz9Kzuksspq+mS5jzYgBtxtm+pJhZx0OjFEjsdEihzYgGBamRAhltC3lJYOcy3A a86YkJq6RZI+ysYGuo47Iqaifi94NmmC7N4z4HQsP7MD1R3FJhvMcsiFYT27moYZIpw== X-Google-Smtp-Source: AGHT+IFrKWwlaAUya8Yli1nCOorEA/KpxuqS3v1hVkOz15yubQ07yn8IQ9kf46okWkSiras7gmOlhg== X-Received: by 2002:a05:6402:42d4:b0:5ff:f524:90e0 with SMTP id 4fb4d7f45d1cf-6008a5a10c5mr13057489a12.11.1747692666809; Mon, 19 May 2025 15:11:06 -0700 (PDT) Received: from localhost (2a02-a45d-7bea-1-5c2d-42a0-14cf-f29c.fixed6.kpn.net. [2a02:a45d:7bea:1:5c2d:42a0:14cf:f29c]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-6005ac32f9esm6277655a12.55.2025.05.19.15.11.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 May 2025 15:11:06 -0700 (PDT) From: Bart Otten To: bug-gnu-emacs@gnu.org Subject: 30.0.92; tree-sitter elixir-ts-mode structural movement broken X-Debbugs-Cc: Date: Tue, 20 May 2025 00:10:54 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=bart.otten85@gmail.com; helo=mail-ed1-x534.google.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.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Greetings and salutions, Trying to use elixir treesit mode, it seems the navigation of defun and lists seems broken. 1.) `defmodule` is considered a function definition and so moving up from the first actual function definition `def my_fun do` causes the point to jump to 'defmodule my_mod do'. Invoking `end-of-defun [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (bart.otten85[at]gmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (bart.otten85[at]gmail.com) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 20 May 2025 00:29:16 -0400 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: 0.2 (/) Greetings and salutions, Trying to use elixir treesit mode, it seems the navigation of defun and lists seems broken. 1.) `defmodule` is considered a function definition and so moving up from the first actual function definition `def my_fun do` causes the point to jump to 'defmodule my_mod do'. Invoking `end-of-defun` jumps to the end of the defmodule block. Effectively, you have been ejected from the module body. ;; current scoped workaround ;; does not jump up to defmodule when using `beginning-of-defun` (defun elixir-ts--defun-p (node) "Return non-nil when NODE is a defun." (member (treesit-node-text (treesit-node-child-by-field-name node "target")) (append (remove "defmodule" elixir-ts--definition-keywords) elixir-ts--test-definition-keywords))) 2.) When you use `down-list` while on a function definition line, nothing happens. I tried to fix it, ony to find out that `backward-up-list` will jump to `defmodule` when invoked while point is at a function argument, instead of navigating out of the argument list only. Structural movement might need some extra love. Cheers, Bart Major mode: Elixir Minor modes in effect: electric-pair-mode: t eglot--managed-mode: t exunit-mode: t mix-minor-mode: t global-org-modern-mode: t display-line-numbers-mode: t global-treesit-auto-mode: t doom-modeline-mode: t which-key-mode: t org-super-agenda-mode: t undo-fu-session-global-mode: t undo-fu-session-mode: t apprentice-mode: t apprentice-hooks-mode: t flymake-mode: t yas-minor-mode: t treesit-inspect-mode: t global-visual-wrap-prefix-mode: t visual-wrap-prefix-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t prettify-symbols-mode: t From debbugs-submit-bounces@debbugs.gnu.org Tue May 20 02:55:58 2025 Received: (at 78503) by debbugs.gnu.org; 20 May 2025 06:55:58 +0000 Received: from localhost ([127.0.0.1]:52756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uHGtJ-0002g2-MC for submit@debbugs.gnu.org; Tue, 20 May 2025 02:55:58 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:54505) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uHGtG-0002f8-49 for 78503@debbugs.gnu.org; Tue, 20 May 2025 02:55:55 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id BBE2B43C67; Tue, 20 May 2025 06:55:45 +0000 (UTC) From: Juri Linkov To: Bart Otten Subject: Re: bug#78503: 30.0.92; tree-sitter elixir-ts-mode structural movement broken In-Reply-To: Organization: LINKOV.NET References: Date: Tue, 20 May 2025 09:46:34 +0300 Message-ID: <87bjrnn5r5.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefvdefheelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepfedprhgtphhtthhopeejkeehtdefseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepfihkihhrshgthhgsrghumhesghhmrghilhdrtghomhdprhgtphhtthhopegsrghrthdrohhtthgvnhekheesghhmrghilhdrtghomh X-GND-Sasl: juri@linkov.net X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 78503 Cc: Wilhelm H Kirschbaum , 78503@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: -2.7 (--) > Trying to use elixir treesit mode, it seems the navigation of defun and lists seems broken. > > 1.) `defmodule` is considered a function definition and so moving up from the first > actual function definition `def my_fun do` causes the point to jump to > 'defmodule my_mod do'. Invoking `end-of-defun` jumps to the end of the defmodule block. > Effectively, you have been ejected from the module body. > > ;; current scoped workaround > ;; does not jump up to defmodule when using `beginning-of-defun` > (defun elixir-ts--defun-p (node) > "Return non-nil when NODE is a defun." > (member (treesit-node-text > (treesit-node-child-by-field-name node "target")) > (append > (remove "defmodule" elixir-ts--definition-keywords) > elixir-ts--test-definition-keywords))) This behavior may look logically flawed, but still it makes sense for user convenience: while navigating with 'C-M-a' it's handy to use the same key to move over modules too. The same navigation exists in other ts-modes as well: for example, in java-ts-mode 'C-M-a' moves over classes, etc. OTOH, in ruby-ts-mode it's restricted to methods only. > 2.) When you use `down-list` while on a function definition line, > nothing happens. I tried to fix it, ony to find out that > `backward-up-list` will jump to `defmodule` when invoked while point is at a > function argument, instead of navigating out of the argument list only. > > Structural movement might need some extra love. This part is not reproducible. Do you use the latest master? From debbugs-submit-bounces@debbugs.gnu.org Tue May 20 08:07:52 2025 Received: (at 78503) by debbugs.gnu.org; 20 May 2025 12:07:52 +0000 Received: from localhost ([127.0.0.1]:56311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uHLlA-000583-6O for submit@debbugs.gnu.org; Tue, 20 May 2025 08:07:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50144) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uHLl6-00057C-PX for 78503@debbugs.gnu.org; Tue, 20 May 2025 08:07:49 -0400 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 1uHLkx-0007yB-F0; Tue, 20 May 2025 08:07:40 -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=IXJRNiIC5rFyUVOUZRGhIPZC58jgqv8XyQXTtzqRNPk=; b=iIHCM3lLJjGo bkuP/EPdSZjEmm2JpnhCAoZapFrYUVlQaQbnu8iTe+aX7MtcYNpmgcYGY/SGlDchbpyzCYqx4OQRG gD8AnR94ofVTQ1hhGJ7FIIhx2ebWgCVwEIgQ7adJ0LLDhvXrFZf0j8RaM3WxuQ07lsdrwN7d00Ev7 VqngOrUXXwly4EHdq5cEVDvTTgQ4rtHnIftE/nNzT/Xh+45sIAF3WqoPW3QW3f32hs0+PNPZTNmuO jvQEUqDHBIo83z2g83KkRoPBOtSA7F4+mgm3LbZILgZ+orW0NCxocAs4DKvhspT88rCxyr70ytzQh IsVaphHeqQMbj8/u9KtDuA==; Date: Tue, 20 May 2025 15:07:11 +0300 Message-Id: <86y0ur8p00.fsf@gnu.org> From: Eli Zaretskii To: Bart Otten , Wilhelm Kirschbaum , Juri Linkov In-Reply-To: (message from Bart Otten on Tue, 20 May 2025 00:10:54 +0200) Subject: Re: bug#78503: 30.0.92; tree-sitter elixir-ts-mode structural movement broken References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78503 Cc: 78503@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 (---) > From: Bart Otten > Date: Tue, 20 May 2025 00:10:54 +0200 > > Greetings and salutions, > > Trying to use elixir treesit mode, it seems the navigation of defun and lists seems broken. > > 1.) `defmodule` is considered a function definition and so moving up from the first > actual function definition `def my_fun do` causes the point to jump to > 'defmodule my_mod do'. Invoking `end-of-defun` jumps to the end of the defmodule block. > Effectively, you have been ejected from the module body. > > ;; current scoped workaround > ;; does not jump up to defmodule when using `beginning-of-defun` > (defun elixir-ts--defun-p (node) > "Return non-nil when NODE is a defun." > (member (treesit-node-text > (treesit-node-child-by-field-name node "target")) > (append > (remove "defmodule" elixir-ts--definition-keywords) > elixir-ts--test-definition-keywords))) > > > 2.) When you use `down-list` while on a function definition line, > nothing happens. I tried to fix it, ony to find out that > `backward-up-list` will jump to `defmodule` when invoked while point is at a > function argument, instead of navigating out of the argument list only. > > Structural movement might need some extra love. Thanks. Wilhelm and Juri, any comments? From debbugs-submit-bounces@debbugs.gnu.org Tue May 20 12:48:29 2025 Received: (at 78503) by debbugs.gnu.org; 20 May 2025 16:48:30 +0000 Received: from localhost ([127.0.0.1]:34057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uHQ8j-0000Ch-Bl for submit@debbugs.gnu.org; Tue, 20 May 2025 12:48:29 -0400 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]:48953) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uHQ8g-0000Be-GJ for 78503@debbugs.gnu.org; Tue, 20 May 2025 12:48:27 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 526E84315F; Tue, 20 May 2025 16:48:16 +0000 (UTC) From: Juri Linkov To: Bart Otten Subject: Re: bug#78503: 30.0.92; tree-sitter elixir-ts-mode structural movement broken In-Reply-To: Organization: LINKOV.NET References: <87bjrnn5r5.fsf@mail.linkov.net> Date: Tue, 20 May 2025 19:46:02 +0300 Message-ID: <87v7pvb585.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdejfeculddtuddrgeefvddrtddtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghofhffkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecuggftrfgrthhtvghrnhepffegteefveelhfeljeefueehieduiedtfffhuddtkeeffffghfevheetgeeukeehnecukfhppeeluddruddvledruddthedruddujeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeluddruddvledruddthedruddujedphhgvlhhopehmrghilhdrghgrnhguihdrnhgvthdpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnsggprhgtphhtthhopeefpdhrtghpthhtohepjeekhedtfeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopeifkhhirhhstghhsggruhhmsehgmhgrihhlrdgtohhmpdhrtghpthhtohepsggrrhhtrdhothhtvghnkeehsehgmhgrihhlrdgtohhm X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78503 Cc: Wilhelm H Kirschbaum , 78503@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: -1.7 (-) >>> 1.) `defmodule` is considered a function definition and so moving up from the first >>> actual function definition `def my_fun do` causes the point to jump to >>> 'defmodule my_mod do'. Invoking `end-of-defun` jumps to the end of the defmodule block. >>> Effectively, you have been ejected from the module body. >>> >> >> This behavior may look logically flawed, >> but still it makes sense for user convenience: >> while navigating with 'C-M-a' it's handy >> to use the same key to move over modules too. > > This would be convenient if list-down would make you jump into the > module body, ready for a jump to the next defun. But currently it does > not. This is exactly what 'down-list' does after removing 'treesit-cycle-sexp-type' from 'elixir-ts-mode'. (You can use the command 'M-x treesit-cycle-sexp-type RET' to toggle interactively.) So 'C-M-f' navigation should use the 'sexp' thing while 'C-M-d' should use 'list' thing. Then let's add a new variable like 'treesit-sexp-type-regexp' e.g. named 'treesit-down-list-regexp' (maybe without a command to toggle it). > Also Elixir files usually have only one module, so the optimalization > to move to other modules might have more downsides than advantages. Agreed. >>> 2.) When you use `down-list` while on a function definition line, >>> nothing happens. I tried to fix it, ony to find out that >>> `backward-up-list` will jump to `defmodule` when invoked while point is at a >>> function argument, instead of navigating out of the argument list only. >>> >>> Structural movement might need some extra love. >> >> This part is not reproducible. Do you use the latest master? > > Now I do. The issue does not replicate in the same way, but still the > behavior is unextected to me and less convienient than hoped for. > > ``` > def foo(arg) do > IO.inspect("some") > end > ``` > > Expected: > - into args > - nice to have: into do block (after do) > - into argument list > - into quoted string This is exactly how 'C-M-d' already works when you toggle 'M-x treesit-cycle-sexp-type RET'. > Actual: > - after def > - after closing paren > - after do > - onto opening paren > - into argument list > - into quoted string > > ``` > defmodule Foo do > def my_fun(), do: :bar > end > ``` > > Expected: > - into module body (after do) This is what 'C-M-d' already does after 'M-x treesit-cycle-sexp-type RET'. So let's enable 'treesit-cycle-sexp-type' by default, but only for 'down-list'. > Actual: > - after defmodule > - after Foo > - into module body (after do) Ok, I will create a new variable 'treesit-down-list-regexp' for 'down-list'. From debbugs-submit-bounces@debbugs.gnu.org Wed May 21 02:34:12 2025 Received: (at 78503) by debbugs.gnu.org; 21 May 2025 06:34:12 +0000 Received: from localhost ([127.0.0.1]:43235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uHd1n-00049m-PN for submit@debbugs.gnu.org; Wed, 21 May 2025 02:34:12 -0400 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]:52019) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uHd1i-00048s-Hj for 78503@debbugs.gnu.org; Wed, 21 May 2025 02:34:07 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 3E80243152; Wed, 21 May 2025 06:33:56 +0000 (UTC) From: Juri Linkov To: Bart Otten Subject: Re: bug#78503: 30.0.92; tree-sitter elixir-ts-mode structural movement broken In-Reply-To: <87v7pvb585.fsf@mail.linkov.net> Organization: LINKOV.NET References: <87bjrnn5r5.fsf@mail.linkov.net> <87v7pvb585.fsf@mail.linkov.net> Date: Wed, 21 May 2025 09:32:04 +0300 Message-ID: <877c2abhjv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgddvfeejucdltddurdegfedvrddttddmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepfedprhgtphhtthhopeejkeehtdefseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepfihkihhrshgthhgsrghumhesghhmrghilhdrtghomhdprhgtphhtthhopegsrghrthdrohhtthgvnhekheesghhmrghilhdrtghomh X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78503 Cc: Wilhelm H Kirschbaum , 78503@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: -1.7 (-) >>> 1.) `defmodule` is considered a function definition and so moving up from the first >>> actual function definition `def my_fun do` causes the point to jump to >>> 'defmodule my_mod do'. Invoking `end-of-defun` jumps to the end of the defmodule block. >> >> Also Elixir files usually have only one module, so the optimalization >> to move to other modules might have more downsides than advantages. Let's wait when Wilhelm will confirm this change. >>>> 2.) When you use `down-list` while on a function definition line, >>>> nothing happens. I tried to fix it, ony to find out that >>>> `backward-up-list` will jump to `defmodule` when invoked while point is at a >>>> function argument, instead of navigating out of the argument list only. > > Ok, I will create a new variable 'treesit-down-list-regexp' for 'down-list'. A new variable is added now, so this part is fixed. From debbugs-submit-bounces@debbugs.gnu.org Thu May 22 02:46:29 2025 Received: (at 78503) by debbugs.gnu.org; 22 May 2025 06:46:29 +0000 Received: from localhost ([127.0.0.1]:59074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uHzhE-0007PN-Rl for submit@debbugs.gnu.org; Thu, 22 May 2025 02:46:29 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]:59921) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uHzgx-0007MW-K5 for 78503@debbugs.gnu.org; Thu, 22 May 2025 02:46:14 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id D4A7043A49; Thu, 22 May 2025 06:46:03 +0000 (UTC) From: Juri Linkov To: Bart Otten Subject: Re: bug#78503: 30.0.92; tree-sitter elixir-ts-mode structural movement broken In-Reply-To: Organization: LINKOV.NET References: <87bjrnn5r5.fsf@mail.linkov.net> <87v7pvb585.fsf@mail.linkov.net> Date: Thu, 22 May 2025 09:39:08 +0300 Message-ID: <8734cxxi9b.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdehvdejucdltddurdegfedvrddttddmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdefrddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeluddruddvledruddtfedrvdejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepfedprhgtphhtthhopeejkeehtdefseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepfihkihhrshgthhgsrghumhesghhmrghilhdrtghomhdprhgtphhtthhopegsrghrthdrohhtthgvnhekheesghhmrghilhdrtghomh X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78503 Cc: Wilhelm H Kirschbaum , 78503@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: -1.7 (-) >>> ``` >>> def foo(arg) do >>> IO.inspect("some") >>> end >>> ``` >>> >>> Expected: >>> - into args >>> - nice to have: into do block (after do) >>> - into argument list >>> - into quoted string >> >> This is exactly how 'C-M-d' already works when you toggle >> 'M-x treesit-cycle-sexp-type RET'. > > It does jump to into args (inside the parens), but after that it does nothing but show a > message indicating it is at the bottom level. Which afaik it is not. > > To be clear: > - on a of arg > - nice to have: into do block (after do) > - on " of "some" > - nice to have: on s of "some" 'down-list' can't go out of a position inside "(arg)" because it is at the bottom level of parenthesis. This is what 'up-list' intended to do. So you need to type 'M-)' or anything that is bound to 'up-list'. >> This is what 'C-M-d' already does after 'M-x treesit-cycle-sexp-type RET'. > > Confirmed > >> So let's enable 'treesit-cycle-sexp-type' by default, but only for >> 'down-list'. > > Would be great. Thanks, done. From debbugs-submit-bounces@debbugs.gnu.org Fri May 23 08:50:29 2025 Received: (at 78503) by debbugs.gnu.org; 23 May 2025 12:50:29 +0000 Received: from localhost ([127.0.0.1]:46821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIRr2-0008ML-GC for submit@debbugs.gnu.org; Fri, 23 May 2025 08:50:28 -0400 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]:44176) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uIRqy-0008H3-7O for 78503@debbugs.gnu.org; Fri, 23 May 2025 08:50:25 -0400 Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-476a720e806so82759121cf.0 for <78503@debbugs.gnu.org>; Fri, 23 May 2025 05:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748004618; x=1748609418; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xPJxUlGafnI8zIYa2v1jQbuvkTyiKOP3Nf5Uv2bc6xI=; b=Ke276uAMtwUB/9FbjKqwYPWlJMPrtz8WhBAZyEB6H/74GTzP7w7drgEWiYJschSJet xLdR/GirJaAp8MGb4DGqZ4pxu8TM/z5VtqiAc8550U9g0gK2usqL2kMgh/oIaLPnIM56 0VSgLzlkxXAGrg4j0UvjGqK414jREILme5bz7bAY2b+WlLDCmNLetuQK1M3B2tozUmfI 2TaXwY3U7A/SidvQfvK0iryKjQJNBaRRuvYf28KyfYmodB0jcyVo7X0sSkmoHSlWFoe4 JqAUHF+pmCej5d5gSzlcmdeDOK08tTfbtO0dhYRpM7agKRWDUFticPXMKo8sDccHsIjW jyPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748004618; x=1748609418; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xPJxUlGafnI8zIYa2v1jQbuvkTyiKOP3Nf5Uv2bc6xI=; b=svrOrG/mZEC60jXFK9ELz93cCt1SZwWvibofls4atKJAY4arvOAp4ytjgoah3O4JTe p0gD0HkXnEi4ojmpbQSxFNTGm2J8PJEMPaY2Gi2Ty924IO/y2F3wUeJlSaGx1iWdUaNS bbIN8fQLhE6IAnikzlSSZhO/85GskNqlaOhk9WkRkEcLs9/SM/AnmBZFVpMl3skGunD8 ZHSm7xGgUddgATkKqHDMdpa1GAhhKR6/heXBfzBXKLSfbuA1rUua75VcY4D+MHtC7LPR BKkztjCvVkK0vPqlDgkKsbfdZMHUeANcYBgQxEGD7cN6FeJrYzXaT0EImaSkLI233BKY KmvA== X-Forwarded-Encrypted: i=1; AJvYcCWC3pigaFnkcwcx7w3u+HJpXhIQ4qzmEthhQNeMm8e7ZtswmL8hVsbL/XWWsXKFzXnEaPVVEA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yye+HMQaRF6RgY+N/VgGoLEM02mYEyWxuLD9MCLphaglXdF3XCs gHy+hf0kni+3W0D/7QYVCCP1AIIs9QRo/V180Kzu8ikN5YpePG9UOOBBPx7oZeG33GL6OZX/6sK MQwCbbnxFp1/TumYffhV8DyTLQyYd8eA= X-Gm-Gg: ASbGncvxnZFqpxTEiQwQBK4lVq19+9irUOVMRgLD4ZoEMilrwEIseT8SqplsV/uObWb fOsVvXFFPuV2Yvq9T1Dr9v8QR38iomReFGx7RuXtkJSwLL/ZBhEGJfZ0rHUzBhcYxaqiQ+H+PqD EfM1j2fooqxGl9KPSMe13f2H6cK50IbJ8hAQ== X-Google-Smtp-Source: AGHT+IGdViyY1l9UM4RqeMZ/GKiV66cDeXGGEMznLoqhnLapAd+gM9+DAe5Rx24sbu0Z+yeA/jqgm8nxSVFEmPwF+tg= X-Received: by 2002:ac8:690f:0:b0:494:9ffc:fcd7 with SMTP id d75a77b69052e-494ae3573b6mr452004941cf.12.1748004618030; Fri, 23 May 2025 05:50:18 -0700 (PDT) MIME-Version: 1.0 References: <87bjrnn5r5.fsf@mail.linkov.net> <87v7pvb585.fsf@mail.linkov.net> <8734cxxi9b.fsf@mail.linkov.net> In-Reply-To: <8734cxxi9b.fsf@mail.linkov.net> From: Wilhelm Kirschbaum Date: Fri, 23 May 2025 14:50:06 +0200 X-Gm-Features: AX0GCFvfKeCyo6uykLreSqcLkplRTbfQV1bT7rToNASxTnIYvfVWDT7tchGuUcE Message-ID: Subject: Re: bug#78503: 30.0.92; tree-sitter elixir-ts-mode structural movement broken To: Juri Linkov Content-Type: multipart/alternative; boundary="00000000000052d1ef0635cd0abf" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78503 Cc: Bart Otten , 78503@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: -1.0 (-) --00000000000052d1ef0635cd0abf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 22, 2025 at 8:46=E2=80=AFAM Juri Linkov wrote= : > >>> ``` > >>> def foo(arg) do > >>> IO.inspect("some") > >>> end > >>> ``` > >>> > >>> Expected: > >>> - into args > >>> - nice to have: into do block (after do) > >>> - into argument list > >>> - into quoted string > >> > >> This is exactly how 'C-M-d' already works when you toggle > >> 'M-x treesit-cycle-sexp-type RET'. > > > > It does jump to into args (inside the parens), but after that it does > nothing but show a > > message indicating it is at the bottom level. Which afaik it is not. > > > > To be clear: > > - on a of arg > > - nice to have: into do block (after do) > > - on " of "some" > > - nice to have: on s of "some" > > 'down-list' can't go out of a position inside "(arg)" > because it is at the bottom level of parenthesis. > This is what 'up-list' intended to do. So you need > to type 'M-)' or anything that is bound to 'up-list'. > > >> This is what 'C-M-d' already does after 'M-x treesit-cycle-sexp-type > RET'. > > > > Confirmed > > > >> So let's enable 'treesit-cycle-sexp-type' by default, but only for > >> 'down-list'. > > > > Would be great. > > Thanks, done. > Hi, sorry for the delay. I had a look at the latest changes and it makes sense to me. Thanks again Juri :). Kind regards, Wilhelm --00000000000052d1ef0635cd0abf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, May 22, 2025 at 8:46=E2=80=AFAM J= uri Linkov <juri@linkov.net> w= rote:
>>> ```
>>> def foo(arg) do
>>>=C2=A0 =C2=A0 IO.inspect("some")
>>> end
>>> ```
>>>
>>> Expected:
>>> - into args
>>> - nice to have: into do block (after do)
>>> - into argument list
>>> - into quoted string
>>
>> This is exactly how 'C-M-d' already works when you toggle<= br> >> 'M-x treesit-cycle-sexp-type RET'.
>
> It does jump to into args (inside the parens), but after that it does = nothing but show a
> message indicating it is at the bottom level. Which afaik it is not. >
> To be clear:
> - on a of arg
> - nice to have: into do block (after do)
> - on " of "some"
> - nice to have: on s of "some"

'down-list' can't go out of a position inside "(arg)"=
because it is at the bottom level of parenthesis.
This is what 'up-list' intended to do.=C2=A0 So you need
to type 'M-)' or anything that is bound to 'up-list'.

>> This is what 'C-M-d' already does after 'M-x treesit-c= ycle-sexp-type RET'.
>
> Confirmed
>
>> So let's enable 'treesit-cycle-sexp-type' by default, = but only for
>> 'down-list'.
>
> Would be great.

Thanks, done.

Hi, sorry for the delay.= =C2=A0

I had a look at the latest changes and it m= akes sense to me. Thanks again Juri :).

Kind regar= ds,=C2=A0
Wilhelm

=C2=A0
--00000000000052d1ef0635cd0abf-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 23 14:28:15 2025 Received: (at 78503) by debbugs.gnu.org; 23 May 2025 18:28:15 +0000 Received: from localhost ([127.0.0.1]:50451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIX7v-0002WT-2i for submit@debbugs.gnu.org; Fri, 23 May 2025 14:28:15 -0400 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]:53433) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uIX7p-0002VV-Ih for 78503@debbugs.gnu.org; Fri, 23 May 2025 14:28:10 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id C3FC743D66; Fri, 23 May 2025 18:28:01 +0000 (UTC) From: Juri Linkov To: Wilhelm Kirschbaum Subject: Re: bug#78503: 30.0.92; tree-sitter elixir-ts-mode structural movement broken In-Reply-To: Organization: LINKOV.NET References: <87bjrnn5r5.fsf@mail.linkov.net> <87v7pvb585.fsf@mail.linkov.net> <8734cxxi9b.fsf@mail.linkov.net> Date: Fri, 23 May 2025 21:23:11 +0300 Message-ID: <87plfzrxtc.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdelheejucdltddurdegfedvrddttddmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdefrddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeluddruddvledruddtfedrvdejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepfedprhgtphhtthhopeejkeehtdefseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepsggrrhhtrdhothhtvghnkeehsehgmhgrihhlrdgtohhmpdhrtghpthhtohepfihkihhrshgthhgsrghumhesghhmrghilhdrtghomh X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78503 Cc: Bart Otten , 78503@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: -1.7 (-) > Hi, sorry for the delay. > > I had a look at the latest changes and it makes sense to me. Thanks again > Juri :). This was only the second part. But what do you think about the first part about removing `defmodule` from 'C-M-a' defun navigation: 1.) `defmodule` is considered a function definition and so moving up from the first actual function definition `def my_fun do` causes the point to jump to 'defmodule my_mod do'. Invoking `end-of-defun` jumps to the end of the defmodule block. Effectively, you have been ejected from the module body. ;; current scoped workaround ;; does not jump up to defmodule when using `beginning-of-defun` (defun elixir-ts--defun-p (node) "Return non-nil when NODE is a defun." (member (treesit-node-text (treesit-node-child-by-field-name node "target")) (append (remove "defmodule" elixir-ts--definition-keywords) elixir-ts--test-definition-keywords))) From debbugs-submit-bounces@debbugs.gnu.org Mon May 26 02:52:23 2025 Received: (at 78503) by debbugs.gnu.org; 26 May 2025 06:52:23 +0000 Received: from localhost ([127.0.0.1]:53171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uJRh8-0007zv-TI for submit@debbugs.gnu.org; Mon, 26 May 2025 02:52:23 -0400 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]:61539) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uJRh6-0007zL-6d for 78503@debbugs.gnu.org; Mon, 26 May 2025 02:52:20 -0400 Received: by mail-qt1-x831.google.com with SMTP id d75a77b69052e-4769aef457bso24775481cf.2 for <78503@debbugs.gnu.org>; Sun, 25 May 2025 23:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748242334; x=1748847134; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JpmHn7hsiZ5e7JBdd7JZncAfOBgWbJhq4qfqC9flK9Y=; b=EGujkF2LS67qpkujl0CyAag0yvew8f0ZKx6kPSmZe1rdYOQYue5DlIgapx6IZCmFUi Mtj5p7eysvkOZgzkg3WNo4kTu0/uzVhL2rWyZ6WJ3xLbQcM8tHYf5kOO+BOCrcxoR2rq dX5uOy/0OvI9UEiR/h3BGe9pZg7bL7KMLmyT/iEUWkHP8m5gwqxErHm6YARw73lnfW5/ wP7mk8/Sr+Yat8g9GcJLAgI6bgVPFO887QVzoFrrvudtFm9CtE8i4ZW/MO9XWsOWjZh6 JdXgVZT+FsdNnGrJdj6xJdc1uAP7IaNzVEPwGHqJOOGvYJwZKgSjATisXzbPIPyzboOj zUOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748242334; x=1748847134; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JpmHn7hsiZ5e7JBdd7JZncAfOBgWbJhq4qfqC9flK9Y=; b=w3jq6Cj/NIt/dzxjBipcQLO9YV/PFlpI2SXiQ7X7KYheoE2Q88jWvlIowaNK+I8gEv B2+MZ+oME3n+KvLFnljlJvR+z7S+szrDf7ugJPWd7gePgw57sJXhpDSDAWENkrDGoYqj Kk9onJMCyFNo74FNvwqhJCnpYi3NmtpK0UMXwkhv3RzOQLJPZWoOVz+fbtfdOfWBWsuC L3w6iNrGKGjd/Kj2DFq76Gk5/qs/r14wWtNzz4FDouH1HffOd3AUjGmRAX+S/OaJApps 8YHkHrm+uQZgq0rdQV0+yoafpZcTqYXsa5uLW11vnCtRd3WhCnDO0HCRwDn7wP6P16hp X9SA== X-Forwarded-Encrypted: i=1; AJvYcCXfLI0Q++MmFxF9QgXylmOTz3z78+KscMyzwShAaAOcXrD7OuIbKO9kNCfcbwCTisFBsD+vlg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyCvnF6bv/AYgD1OnVK7OLslMdcecwX8sGc3W+efOBF97p5+x7H I5NhCdZ4qDOkbvLGZLjDklgV7ZscwLRT4ghzPX2iKDYXighpJf5Fp9cP86FgDYw9Sn3Xn9VMXNZ CgT+uOaUTn/3cQU93kaaOmYaVJXEYM4A= X-Gm-Gg: ASbGncsOGPSz5kyIxii7NhVri/BRvJGogbHK7tyjDm8iQK6Th1fr9RXwpCgUny0mmdE ZCdMYmHyV/ssdVnHwo5BPiVKg6PQEUN+Qr/deWkqwhlKMdfNOvWaFjK7PHPR+brNoBaKs2XaUq2 nBWtF5Icy7Y0AixrXtR4eIHjZpzDyA0HfXjg== X-Google-Smtp-Source: AGHT+IG8yhNtYWBEZn12L6tuvrh0IVDvDzJ2jOVj+8mqJyIwMXZJVtJpqqEpjkjUuICtCbj7mTVFnguYUjh1ExnFG+Y= X-Received: by 2002:a05:622a:1e0b:b0:477:13b7:8336 with SMTP id d75a77b69052e-49f4655bc17mr130873121cf.17.1748242334229; Sun, 25 May 2025 23:52:14 -0700 (PDT) MIME-Version: 1.0 References: <87bjrnn5r5.fsf@mail.linkov.net> <87v7pvb585.fsf@mail.linkov.net> <8734cxxi9b.fsf@mail.linkov.net> <87plfzrxtc.fsf@mail.linkov.net> In-Reply-To: <87plfzrxtc.fsf@mail.linkov.net> From: Wilhelm Kirschbaum Date: Mon, 26 May 2025 08:52:02 +0200 X-Gm-Features: AX0GCFsGihhTrfrJeJnLS2f1yxKMB6bad7FEnPRYH0U_POY6md2fjPEJyUyi4dk Message-ID: Subject: Re: bug#78503: 30.0.92; tree-sitter elixir-ts-mode structural movement broken To: Juri Linkov Content-Type: multipart/alternative; boundary="000000000000502aca06360463d4" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78503 Cc: Bart Otten , 78503@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: -1.0 (-) --000000000000502aca06360463d4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, May 23, 2025 at 8:28=E2=80=AFPM Juri Linkov wrote= : > > Hi, sorry for the delay. > > > > I had a look at the latest changes and it makes sense to me. Thanks aga= in > > Juri :). > > This was only the second part. But what do you think about the > first part about removing `defmodule` from 'C-M-a' defun navigation: > > 1.) `defmodule` is considered a function definition and so moving up > from the first > actual function definition `def my_fun do` causes the point to jump to > 'defmodule my_mod do'. Invoking `end-of-defun` jumps to the end of the > defmodule block. > Effectively, you have been ejected from the module body. > > ;; current scoped workaround > ;; does not jump up to defmodule when using `beginning-of-defun` > (defun elixir-ts--defun-p (node) > "Return non-nil when NODE is a defun." > (member (treesit-node-text > (treesit-node-child-by-field-name node "target")) > (append > (remove "defmodule" elixir-ts--definition-keywords) > elixir-ts--test-definition-keywords))) > It is not ideal to be ejected from the module body and was not the initial desired behaviour. modules can be nested and there can be multiple in a single file, so not being able to navigate with C-M-a is less ideal imo. I remember trying to solve this issue in the early days of treesit.el, but it became too complex, perhaps there is an easier way now? --000000000000502aca06360463d4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, May 23, 2025 at 8:28=E2=80=AFPM J= uri Linkov <juri@linkov.net> w= rote:
> Hi, sorry for the delay.
>
> I had a look at the latest changes and it makes sense to me. Thanks ag= ain
> Juri :).

This was only the second part.=C2=A0 But what do you think about the
first part about removing `defmodule` from 'C-M-a' defun navigation= :

=C2=A0 1.) `defmodule` is considered a function definition and so moving up= from the first
=C2=A0 actual function definition `def my_fun do` causes the point to jump = to
=C2=A0 'defmodule my_mod do'. Invoking `end-of-defun` jumps to the = end of the defmodule block.
=C2=A0 Effectively, you have been ejected from the module body.

=C2=A0 ;; current scoped workaround
=C2=A0 ;; does not jump up to defmodule when using `beginning-of-defun`
=C2=A0 (defun elixir-ts--defun-p (node)
=C2=A0 =C2=A0 "Return non-nil when NODE is a defun."
=C2=A0 =C2=A0 (member (treesit-node-text
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(treesit-node-child-by-fiel= d-name node "target"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (append
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(remove "defmodule&quo= t; elixir-ts--definition-keywords)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0elixir-ts--test-definition-= keywords)))

It is not ideal to be eject= ed from the module body and was not the initial desired behaviour. modules = can be nested and there can be multiple in a single file, so not being able= to navigate with C-M-a is less ideal imo. I remember trying to solve this = issue in the early days of treesit.el, but it became too complex, perhaps t= here is an easier way now?=C2=A0

--000000000000502aca06360463d4-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 27 02:55:25 2025 Received: (at 78503) by debbugs.gnu.org; 27 May 2025 06:55:25 +0000 Received: from localhost ([127.0.0.1]:37143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uJoDd-0007zV-1B for submit@debbugs.gnu.org; Tue, 27 May 2025 02:55:25 -0400 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]:56037) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uJoDS-0007tY-6p for 78503@debbugs.gnu.org; Tue, 27 May 2025 02:55:14 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2693642E7E; Tue, 27 May 2025 06:55:05 +0000 (UTC) From: Juri Linkov To: Wilhelm Kirschbaum Subject: Re: bug#78503: 30.0.92; tree-sitter elixir-ts-mode structural movement broken In-Reply-To: Organization: LINKOV.NET References: <87bjrnn5r5.fsf@mail.linkov.net> <87v7pvb585.fsf@mail.linkov.net> <8734cxxi9b.fsf@mail.linkov.net> <87plfzrxtc.fsf@mail.linkov.net> Date: Tue, 27 May 2025 09:40:25 +0300 Message-ID: <87wma28sny.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdduleejudculddtuddrgeefvddrtddtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghofhffkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecuggftrfgrthhtvghrnhepffegteefveelhfeljeefueehieduiedtfffhuddtkeeffffghfevheetgeeukeehnecukfhppeeluddruddvledruddtfedrvdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdefrddvjedphhgvlhhopehmrghilhdrghgrnhguihdrnhgvthdpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnsggprhgtphhtthhopeefpdhrtghpthhtohepjeekhedtfeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegsrghrthdrohhtthgvnhekheesghhmrghilhdrtghomhdprhgtphhtthhopeifkhhirhhstghhsggruhhmsehgmhgrihhlrdgtohhm X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78503 Cc: Bart Otten , 78503@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: -1.7 (-) > 1.) `defmodule` is considered a function definition and so moving up > from the first > actual function definition `def my_fun do` causes the point to jump to > 'defmodule my_mod do'. Invoking `end-of-defun` jumps to the end of > the defmodule block. > Effectively, you have been ejected from the module body. > > ;; current scoped workaround > ;; does not jump up to defmodule when using `beginning-of-defun` > (defun elixir-ts--defun-p (node) > "Return non-nil when NODE is a defun." > (member (treesit-node-text > (treesit-node-child-by-field-name node "target")) > (append > (remove "defmodule" elixir-ts--definition-keywords) > elixir-ts--test-definition-keywords))) > > It is not ideal to be ejected from the module body and was not the initial > desired behaviour. modules can be nested and there can be multiple in a > single file, so not being able to navigate with C-M-a is less ideal imo. I > remember trying to solve this issue in the early days of treesit.el, but it > became too complex, perhaps there is an easier way now? An easier way is proposed above with (remove "defmodule" elixir-ts--definition-keywords). From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 08 03:20:29 2025 Received: (at 78503) by debbugs.gnu.org; 8 Jun 2025 07:20:29 +0000 Received: from localhost ([127.0.0.1]:50551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uOAKT-0005Yu-0R for submit@debbugs.gnu.org; Sun, 08 Jun 2025 03:20:29 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:55947) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uOAKR-0005Yf-0a for 78503@debbugs.gnu.org; Sun, 08 Jun 2025 03:20:27 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 62BD542DF9; Sun, 8 Jun 2025 07:20:18 +0000 (UTC) From: Juri Linkov To: Bart Otten Subject: Re: bug#78503: 30.0.92; tree-sitter elixir-ts-mode structural movement broken In-Reply-To: Organization: LINKOV.NET References: Date: Sun, 08 Jun 2025 09:58:59 +0300 Message-ID: <871pruln4g.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugdejheegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdefrddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeluddruddvledruddtfedrvdejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepfedprhgtphhtthhopeejkeehtdefseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepsggrrhhtrdhothhtvghnkeehsehgmhgrihhlrdgtohhmpdhrtghpthhtohepfihkihhrshgthhgsrghumhesghhmrghilhdrtghomh X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78503 Cc: Wilhelm H Kirschbaum , 78503@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: -1.7 (-) > 1.) `defmodule` is considered a function definition and so moving up from the first > actual function definition `def my_fun do` causes the point to jump to > 'defmodule my_mod do'. Invoking `end-of-defun` jumps to the end of the defmodule block. > Effectively, you have been ejected from the module body. Hopefully defun navigation will be fixed in bug#68664 and bug#78703.