From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Newsgroups: gmane.emacs.bugs Subject: bug#72489: 29.4.50; forward-comment not working as expected in toml-ts-mode Date: Tue, 6 Aug 2024 15:06:03 +0200 Message-ID: <2BD4ADA2-2D9D-4D63-B08F-668EDF22193F@secure.kjonigsen.net> References: <86cymlq38q.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) 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="28903"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yang Yingchao , "Mr. Jostein =?UTF-8?Q?Kj=C3=B8nigsen?=" , 72489@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 06 15:07:08 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 1sbJu6-0007Hn-Of for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Aug 2024 15:07:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJtg-0000no-U5; Tue, 06 Aug 2024 09:06:40 -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 1sbJtf-0000hA-2H for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 09:06:39 -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 1sbJte-0002Xy-N7 for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 09:06:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:Date:In-Reply-To:From:Mime-Version:To:Subject; bh=6pE2mHp9rjXlpvW/S+lWjHJyEphizJhsm4p3wKuGceA=; b=Bv1OBBP+GF/+pCfTUIw9+u4YY1hiECDy4SdMsHWxrxX2MOGhvqXaNrkR4/z8d5VUu1n3ufk/1yh1T8r3ZQT6+XgUhhh33R4aoQCSOsxog301+YsPZuRbEbCGinUBZnn6BsQd3FpKfqjQpWkhYpke25NgBTTMPAA2eHeGaeDmU75w8f7g81s5HBw4YjE1T8vAK1JHY53mFwOAyRn423J2Es7RN5mDL0KHlLZ6iLCdsOd1dbueqn4w49Jpt28Yf24BbOyqt6xC2FJPTuvIvnkDuEbdoV+K1cd+luwBlpGClK6Y7FI+7bJgMmAPluIxkOyuO3jSA3jUgDoQ+nwJjIETFg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sbJu2-0004Uy-7q for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 09:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Aug 2024 13:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72489 X-GNU-PR-Package: emacs Original-Received: via spool by 72489-submit@debbugs.gnu.org id=B72489.172294960917259 (code B ref 72489); Tue, 06 Aug 2024 13:07:02 +0000 Original-Received: (at 72489) by debbugs.gnu.org; 6 Aug 2024 13:06:49 +0000 Original-Received: from localhost ([127.0.0.1]:60407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbJtp-0004UH-1y for submit@debbugs.gnu.org; Tue, 06 Aug 2024 09:06:49 -0400 Original-Received: from fout1-smtp.messagingengine.com ([103.168.172.144]:54987) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbJtl-0004Tp-HR for 72489@debbugs.gnu.org; Tue, 06 Aug 2024 09:06:47 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.nyi.internal (Postfix) with ESMTP id 8E4F2138830D; Tue, 6 Aug 2024 09:06:16 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 06 Aug 2024 09:06:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1722949576; x=1723035976; bh=6pE2mHp9rj XlpvW/S+lWjHJyEphizJhsm4p3wKuGceA=; b=gA+Hm04n2poVr7BB3Wk2LzOGy+ ojMAKjEq0v8/oZEFmSXlSiOBav98cyJlGiM8xg4VscuUVdlD5BClwaNGgn39Lttz 2d8KenQtJm8VbJNN+Pd8pwJDKy9axiZUeOGtaLza6a+3TGRfbsxeZAKQd28P1+NS NkIVuURkKIdaF9kAT7g94+uUl9LjJ4Va8+gE3DsQpEl1qlL7GrmJv8i1o0rORxS+ won/IkhkMfY1wNnZNASSl5v4s67dB7250ymLQ6dm/6emE8Slt/oCSKe8mlX10k6w 7cNPtXK0FYryu8YPMz0OUNoHwMAKdfQnfcp8rJJ5Hl4ZO8/VRg9WAOCA3Z8g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1722949576; x= 1723035976; bh=6pE2mHp9rjXlpvW/S+lWjHJyEphizJhsm4p3wKuGceA=; b=c G6VIW3GkhZAzfaXVn+tsABLTGR5lXZwWnDS8OzC9UBA373NPeM5YgjhEE0ONFVah hrO8W8sqPR2BHWMvt0dL9f9h6lzFrl5c8GbbSuuyDiTUJKWzjX4hm69Z0b1Az5Vw OZn86wMw5Y9zE0ecgYrw5xVuBOjBWg9wgQMFw+XhKW/KFfxbCOaL36BKPzVOL/2W wk9LT4l7hEUGcpfIR20ZdKXlW5xTbMINWjrrd6X8d23/hx5E0Zebl6p2MN3/DCxS J4wUQ3beOAvl+ZBEiko2TPTpgFHfEe4andYBNJ0qksXnGCFeyEbZYgqELmaTT6he VGMGyVySkokmhvLS1Rxow== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrkeekgdeitdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtggfuhfgjffevgffkfhfvofesthhqmhdthhdtvdenucfhrhhomheplfhoshht vghinhcumfhjpphnihhgshgvnhcuoehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhnih hgshgvnhdrnhgvtheqnecuggftrfgrthhtvghrnheptefhuefhvddtffdvheehtdfhfeeg gfevueellefggefhfeevkeefvdfgffejgeevnecuffhomhgrihhnpehgihhthhhusgdrtg homhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehj ohhsthgvihhnsehsvggtuhhrvgdrkhhjohhnihhgshgvnhdrnhgvthdpnhgspghrtghpth htoheptd X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 6 Aug 2024 09:06:15 -0400 (EDT) In-Reply-To: <86cymlq38q.fsf@gnu.org> X-Mailer: Apple Mail (2.3774.500.171.1.1) 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:289826 Archived-At: > On 6 Aug 2024, at 13:50, Eli Zaretskii wrote: >=20 >> Date: Tue, 06 Aug 2024 13:57:28 +0800 >> From: Yang Yingchao via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >>=20 >>=20 >>=20 >> Steps to reproduce: >>=20 >> 1. Open a new buffer in `toml-ts-mode`. >> 2. Insert the following simple snippets: >> ``` >> # (forward-comment 1) >> # [[keyboard.bindings]] >> # chars =3D "a" >> # key =3D "Tab" >> # mods =3D "Alt" >> ``` >> 3. Move the cursor to the first line and call `eval-last-sexp`. >>=20 >> This should move the cursor to the beginning of the line "chars =3D = a", but actually it moves the cursor to the end of the whole block. >>=20 >> This might be an issue with `toml-ts-mode--syntax-table`. >>=20 >> Making a change in = https://github.com/emacs-mirror/emacs/blob/e993e479c324bb720bca3f1cf194e55= e32f01ccd/lisp/textmodes/toml-ts-mode.el#L53 can fix this issue: >>=20 >> ``` >> - (modify-syntax-entry ?\n "> b" table) >> + (modify-syntax-entry ?\n ">" table) >> ``` >=20 > Thanks. >=20 > Jostein, could you please look into this? Hey there. Let me see if I can help. Just to be clear I understand the issue and how to reproduce it: 1. you create an empty buffer and activate toml-ts-mode 2. you paste in the supplied text, which is all comments according to = TOML syntax 3. first line is actually a commented out emacs-lisp command. 4. you use (eval-last-sexp) to invoke the command emacs-lisp = (forward-comment 1) And once you do that, the expected outcome would be to jump to next = comment-line (ie each commented line is considered its own = comment-block)? I ask, because if I do that, I get an *error* about reaching the end of = file, so it seems like whatever I'm doing I'm getting slightly different = results than you are. Applying the suggested fix does not seem to change = behaviour either? Yang: Have you loaded/compiled/provided the toml typescript-grammar = before using this mode? The *-ts-modes depends on external grammar in order to properly = initialize the major-mode and provide correct highlighting and = indentation. -- Jostein