From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gleb Zakharov Newsgroups: gmane.emacs.bugs Subject: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation Date: Fri, 03 Mar 2023 11:39:08 +0000 Message-ID: <878rge3vz7.fsf@posteo.net> References: <87fsam3wk7.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39146"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61923@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 03 12:40:29 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 1pY3m1-0009zF-Hv for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Mar 2023 12:40:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pY3lc-0006X2-AG; Fri, 03 Mar 2023 06:40:04 -0500 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 1pY3lb-0006WN-CT for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2023 06:40:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pY3la-0001K3-IZ for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2023 06:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pY3la-0002sm-Di for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2023 06:40:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <877cvz5b0t.fsf@posteo.net> Resent-From: Gleb Zakharov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Mar 2023 11:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61923 X-GNU-PR-Package: emacs Original-Received: via spool by 61923-submit@debbugs.gnu.org id=B61923.167784356011014 (code B ref 61923); Fri, 03 Mar 2023 11:40:02 +0000 Original-Received: (at 61923) by debbugs.gnu.org; 3 Mar 2023 11:39:20 +0000 Original-Received: from localhost ([127.0.0.1]:59823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY3kt-0002rZ-UG for submit@debbugs.gnu.org; Fri, 03 Mar 2023 06:39:20 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:47495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY3kr-0002rM-Eq for 61923@debbugs.gnu.org; Fri, 03 Mar 2023 06:39:18 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E723A2405EC for <61923@debbugs.gnu.org>; Fri, 3 Mar 2023 12:39:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1677843551; bh=1P/bqbVwYABrBV+hquW/NhwD+cR6FYDLioNgrPH7UDo=; h=From:To:Cc:Subject:Date:From; b=FMh9DgpXj3eLbLXbSpBMG4UfQBtOz0auDlPEm8XFnKXNTFYTtzdfW3lhOeIOgblqB gMDMroRZaKl6en+/w23yiNuiWwO3lHf0r+N8hrAN2KU6Zbq/7xByLsZ1jLe9XS5lH8 snUe7KfgiOBDZlAv9+ndo9aWu11qVZNTti1Q7QHkc0DA3eVrbxeXzeMUya6//l1Km2 WAK7l984h35aVfJZ7tvdtwVgRNeQZT+jGscuGAJBJpQVU4wEYOHAvnMY6Gm5Ld10XS slKkHllXQ9ySVf/+FQFIfZ0U/HoFw5CsEXUSGNcJV86bAHh9YDYuOvVxQ6er/jgz/n oJ/OqOYkMdCDw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PSmG46g26z6tsZ; Fri, 3 Mar 2023 12:39:08 +0100 (CET) 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:257209 Archived-At: Sorry, forgot to add debbugs.gnu.org to the forward list. -------------------- Start of forwarded message -------------------- Hi Eli, Thanks for the quick reply. Eli Zaretskii writes: > Tweaking the language indentation > rules to cater for these quite specialized use cases is not TRT, IMO, > because it is likely to contradict what the majority of language users > want and expect. I'm not sure if you meant that the special case involves embedding other languages or simply using multi-line strings. While raw strings in Go can be used for various purposes, including the code of other languages, they can also be used for arbitrary text. The issue I'm facing is that when tabs are added by tree-sitter indentation, they become a part of the string, which can affect the program, for example if we want to compare strings with each other. Consider this example: ``` // (require 'treesit) // (require 'go-ts-mode) // (setq treesit-extra-load-path '("/home/snyssfx/.guix-home/profile/lib/tree-sitter")) // (go-ts-mode) func a() { _ = ` Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ` } ``` If I call M-q or make a change somewhere in the string, part of the text inside the string will be re-indented, which will result in additional \t symbols in the string literal. I can undo this indentation with C-/ though, which is how I do it now. > This use case, and others > like it, are supposed to be handled by features that support multiple > major modes in the same buffer. Thanks for the tip, I will take a look, for example indirect buffers can certainly improve my experience here. Best Regards, Gleb -------------------- End of forwarded message --------------------