From unknown Mon Aug 18 04:42:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation Resent-From: Gleb Zakharov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Mar 2023 22:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 61923@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167779564914628 (code B ref -1); Thu, 02 Mar 2023 22:21:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Mar 2023 22:20:49 +0000 Received: from localhost ([127.0.0.1]:58563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXrI8-0003nk-O4 for submit@debbugs.gnu.org; Thu, 02 Mar 2023 17:20:49 -0500 Received: from lists.gnu.org ([209.51.188.17]:32800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXmXp-0007PU-PW for submit@debbugs.gnu.org; Thu, 02 Mar 2023 12:16:42 -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 1pXmXp-000256-Jn for bug-gnu-emacs@gnu.org; Thu, 02 Mar 2023 12:16:41 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXmXn-00089z-7m for bug-gnu-emacs@gnu.org; Thu, 02 Mar 2023 12:16:41 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id AC8E0240639 for ; Thu, 2 Mar 2023 18:16:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1677777395; bh=OlMA8QGeyW3D4EuPMK0GCUzWM3slm8msIsBCi/1Raqk=; h=From:To:Subject:Date:From; b=R9uAaVD2Af97VULNuBS9zB1QLyM8k+CLj7zdzm4qPTnhH9+iJjj55HwAvhGkqDShi L3EJl43LZ3y4q4JDFNDbFwx3J3JtRMIsp1G7zllNPhtTnapKuIUCzgz6JQKOv+aRY9 Wx7pEdKBZNPzVIP4nJBtk94wlDFzwLGlUQyAJVR+uA64YYezRJcTabclg7dytn7s9Q DS2JshpP054iwcxL1IuZbSdsW0xX+H6NpaKD9NmjHHs/ls91jiajL+bAi600thjBdn kYYQ2W8Bma3d7heMSwOWtdeulxlQX7asazad4pZ8OMex+fYD6HmCjMH5pMqqdjvhKy cAeTyCcbtmnMg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PSHnv0lgXz9rxM for ; Thu, 2 Mar 2023 18:16:34 +0100 (CET) From: Gleb Zakharov Date: Thu, 02 Mar 2023 17:16:34 +0000 Message-ID: <877cvz5b0t.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=snyssfx@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Mailman-Approved-At: Thu, 02 Mar 2023 17:20:46 -0500 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.3 (--) Hi everyone, thank you all for the hard work! In Go, I sometimes work with code written in another language. I embed it into Go as string literals, for example, SQL code. When I type a multiline string, I notice that tree-sitter indents it by usual Go rules, but this feature should be turned off inside the string. How to reproduce the behavior with `emacs -Q`: Paste a text from a snippet below, execute lines in the comments to start `go-ts-mode` and type M-q or M-x prog-fill-reindent-defun RET. The text should stay as it is, but things in a multiline string indented. ``` // (require 'treesit) // (require 'go-ts-mode) // (setq treesit-extra-load-path '("/home/snyssfx/.guix-home/profile/lib/tree-sitter")) // (go-ts-mode) func a() { _ = ` SELECT a FROM b WHERE c; if true { panic("doesn't have to be indented") }` } ``` I tried to add ``` ((node-is "raw-string-literal") point-min) ``` to `go-ts-mode--indent-rules`, but it doesn't seem to fix it. The problem doesn't exist for just string literals, as they must not be multiline. Configured using: 'configure CONFIG_SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash --prefix=/gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87 --enable-fast-install --with-modules --with-cairo --with-native-compilation --disable-build-details' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $EMACSLOADPATH: /home/snyssfx/.guix-home/profile/share/emacs/site-lisp:/home/snyssfx/.guix-home/profile/share/emacs/site-lisp:/gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Go Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /gnu/store/bswj8m0vr5pxxqz596wg1vw0l3vhap56-emacs-transient-20230219.1111/share/emacs/site-lisp/transient-20230219.1111/transient hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/transient /gnu/store/nk42g92xzs9c0406xhkg7fq1iyijcn74-emacs-bind-key-20230203.2004/share/emacs/site-lisp/bind-key-20230203.2004/bind-key hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/bind-key /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-delight hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-delight /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-diminish hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-diminish /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-lint hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-lint /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-bind-key hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-bind-key /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-jump hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-jump /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-ensure hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-ensure /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-core hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-core Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date smerge-mode diff-mode easy-mmode diff help-fns radix-tree cl-print byte-opt debug backtrace find-func go-ts-mode treesit cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 97206 10432) (symbols 48 8202 0) (strings 32 23985 1962) (string-bytes 1 788970) (vectors 16 18947) (vector-slots 8 370311 8362) (floats 8 50 38) (intervals 56 629 0) (buffers 984 16)) From unknown Mon Aug 18 04:42:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Mar 2023 07:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gleb Zakharov Cc: 61923@debbugs.gnu.org Received: via spool by 61923-submit@debbugs.gnu.org id=B61923.16778270935668 (code B ref 61923); Fri, 03 Mar 2023 07:05:02 +0000 Received: (at 61923) by debbugs.gnu.org; 3 Mar 2023 07:04:53 +0000 Received: from localhost ([127.0.0.1]:59486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXzTJ-0001TM-7N for submit@debbugs.gnu.org; Fri, 03 Mar 2023 02:04:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXzTH-0001T0-BM for 61923@debbugs.gnu.org; Fri, 03 Mar 2023 02:04:52 -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 1pXzTB-00063B-6c; Fri, 03 Mar 2023 02:04:45 -0500 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=mviPb5z0CvTwXNwu9I7KVHe+kEOrw2KdsSRNPnbU2qs=; b=QJtm8QGY8LSn tnUjEKOY5SctcttjRa8kIa+tG++JBiVWJGc5tMjPN6DqwMGeLAxL+hYGGvRd1IEsivUdIaJR8/83I 3tAza5x6m0AjZ1aLSIzcp1QkJxOc+2JMISbVGCNI0L/7bXXeMIK/+hz3geM83zDA6fPdcs3Xk7p4y i6EhwB+O3tLapZDK4nSU2iJdFQh6zrLDk0nnL/x4/cxgQfbM0r+XTU68i7iKSNSiU7IyMgT4Zoj4F ynuZbNdAQeWSSO/ceT4RPLcVEL8q1V4gzpROmeEaAdPV2x0mfyzusQTBQ/6Uk/9pB1WLa1VL8ZBDd kNPBzYuGcVfcSuXKrYnrwA==; 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 1pXzTA-0007lh-AJ; Fri, 03 Mar 2023 02:04:44 -0500 Date: Fri, 03 Mar 2023 09:04:28 +0200 Message-Id: <83o7paco3n.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <877cvz5b0t.fsf@posteo.net> (message from Gleb Zakharov on Thu, 02 Mar 2023 17:16:34 +0000) References: <877cvz5b0t.fsf@posteo.net> X-Spam-Score: -2.3 (--) 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: Gleb Zakharov > Date: Thu, 02 Mar 2023 17:16:34 +0000 > > In Go, I sometimes work with code written in another language. > I embed it into Go as string literals, for example, SQL code. > > When I type a multiline string, I notice that tree-sitter indents it by > usual Go rules, but this feature should be turned off inside the string. I don't think your conclusion is correct. This use case, and others like it, are supposed to be handled by features that support multiple major modes in the same buffer. 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. So I agree we should support these use cases, just not by changing the general indentation rules of the language inside strings. From unknown Mon Aug 18 04:42:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation Resent-From: Eli Zaretskii 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 X-GNU-PR-Keywords: To: Gleb Zakharov Cc: 61923@debbugs.gnu.org Received: via spool by 61923-submit@debbugs.gnu.org id=B61923.167784355110991 (code B ref 61923); Fri, 03 Mar 2023 11:40:02 +0000 Received: (at 61923) by debbugs.gnu.org; 3 Mar 2023 11:39:11 +0000 Received: from localhost ([127.0.0.1]:59819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY3kk-0002rD-G4 for submit@debbugs.gnu.org; Fri, 03 Mar 2023 06:39:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY3kj-0002r0-8e for 61923@debbugs.gnu.org; Fri, 03 Mar 2023 06:39:09 -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 1pY3kd-0000nx-HN; Fri, 03 Mar 2023 06:39:03 -0500 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=0mgmtGhND3q+sOe7P62zlX2wkQ4hx9ILlzZVej6q8Wk=; b=c8FIytoi4hfJ 07n5MIRey3wdxz8wG7yDJwhXXkI0nKWubcnQx+BaLL6v0lmn9qqQw/EOIBDtoHDXkY3zfgASCieEV YCrl6OThHpFyA1dffd+4DAcVQOWA2XqMic5B4MLkHKcaMAJWWkR3NsiGQIEcLsM5PGf14+jn89gVg XiCSX81UadUAil27AhTM93Z9jSw58nOoFcbu39xIBlWuVp19Bo/Q2gcRdm5P9RmbTabVUdLJCmGRd P3hRLRAjJk9TF8ZLlutoLhNI/VCEZdsfx6k4mtkGDtVfmCN/nM/5QiQxm9tYqC+z+9iUAJaEuZPj3 5XJHt406TqjfC5Tni55YXg==; 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 1pY3kd-0002GZ-0w; Fri, 03 Mar 2023 06:39:03 -0500 Date: Fri, 03 Mar 2023 13:38:47 +0200 Message-Id: <83zg8uawu0.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87fsam3wk7.fsf@posteo.net> (message from Gleb Zakharov on Fri, 03 Mar 2023 11:26:32 +0000) References: <877cvz5b0t.fsf@posteo.net> <83o7paco3n.fsf@gnu.org> <87fsam3wk7.fsf@posteo.net> X-Spam-Score: -2.3 (--) 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 (---) [Please always use Reply All to keep the bug address on the CC list.] > From: Gleb Zakharov > Date: Fri, 03 Mar 2023 11:26:32 +0000 > > 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. The latter. AFAIU, you suggested to change how multi-line strings are indented because of the use case of embedding other languages there. > 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. If you are saying that the indentation inside string is incorrect in general, then I agree we should fix it. (I don't use Go.) But then please present the reproduction recipe which doesn't use another language in the string, but simply has a string, which is corrupted by indentation. > > 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 > From unknown Mon Aug 18 04:42:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation 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 X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 61923@debbugs.gnu.org Received: via spool by 61923-submit@debbugs.gnu.org id=B61923.167784356011014 (code B ref 61923); Fri, 03 Mar 2023 11:40:02 +0000 Received: (at 61923) by debbugs.gnu.org; 3 Mar 2023 11:39:20 +0000 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 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 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== 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) From: Gleb Zakharov References: <87fsam3wk7.fsf@posteo.net> Date: Fri, 03 Mar 2023 11:39:08 +0000 Message-ID: <878rge3vz7.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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 (---) 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 -------------------- From unknown Mon Aug 18 04:42:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation Resent-From: Gleb Zakharov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Mar 2023 14:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 61923@debbugs.gnu.org Received: via spool by 61923-submit@debbugs.gnu.org id=B61923.16778543096218 (code B ref 61923); Fri, 03 Mar 2023 14:39:02 +0000 Received: (at 61923) by debbugs.gnu.org; 3 Mar 2023 14:38:29 +0000 Received: from localhost ([127.0.0.1]:60020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY6YG-0001cD-Vr for submit@debbugs.gnu.org; Fri, 03 Mar 2023 09:38:29 -0500 Received: from mout02.posteo.de ([185.67.36.66]:35999) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY6YE-0001bx-CP for 61923@debbugs.gnu.org; Fri, 03 Mar 2023 09:38:27 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id D45D6240A78 for <61923@debbugs.gnu.org>; Fri, 3 Mar 2023 15:38:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1677854300; bh=yjdvhjDIQwAd35OXe1Pnd8+aFGgUwLNjNesqLA6qDWQ=; h=From:To:Cc:Subject:Date:From; b=in4n3rv4DwLLFcrZCauHOXU6eWljMdjV0LH/j3/2Ex7Z1vv8fPL8ou6lTR2V6WR6J twYERp+Oi8mqmabbmDcGIywAciyKraasT+QIV7mtfikZl6VE3YA+TVXlKGZ3OuxmLz gcKGHyx+tmwQxR3x9bzNoiCkXHQcZIoqOjY+ls0KCOzm2o8jo5K8nm0kznfuUhT+YA vwxA5AptQPN8xF3SMsbVPWU9LkzMxIMSKb8eFHSMUcHASRMzdMfE/AQxT/QqNlZ7Ia Yqvng6PyeBWfBNX8yLUhUdoSjXanPsCh+Ql1iFc4vwkz1WjLa838Ps2ErRk79twzqb YbNwiNZf/CpYQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PSrDr1nmPz9rxH; Fri, 3 Mar 2023 15:38:19 +0100 (CET) From: Gleb Zakharov In-Reply-To: <83zg8uawu0.fsf@gnu.org> References: <877cvz5b0t.fsf@posteo.net> <83o7paco3n.fsf@gnu.org> <87fsam3wk7.fsf@posteo.net> <83zg8uawu0.fsf@gnu.org> Date: Fri, 03 Mar 2023 14:38:19 +0000 Message-ID: <87ttz13nok.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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 (---) Eli Zaretskii writes: > If you are saying that the indentation inside string is incorrect in > general, then I agree we should fix it. (I don't use Go.) But then > please present the reproduction recipe which doesn't use another > language in the string, but simply has a string, which is corrupted by > indentation. Yes, it seems to be incorrect in general. Sorry for the misguidance regarding language embedding, it is just how I noticed the issue. Here is a recipe of how to reproduce it for a usual piece of text in a scratch buffer with `emacs -Q` : ``` /* (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 we call M-q anywhere in a function or insert a new line in the string literal, the text or its part will be indented. However, the expected behavior is for it to stay as it is. Best Regards, Gleb From unknown Mon Aug 18 04:42:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation References: <877cvz5b0t.fsf@posteo.net> In-Reply-To: <877cvz5b0t.fsf@posteo.net> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Mar 2023 22:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: snyssfx@posteo.net Cc: Eli Zaretskii , 61923@debbugs.gnu.org Received: via spool by 61923-submit@debbugs.gnu.org id=B61923.167788259332539 (code B ref 61923); Fri, 03 Mar 2023 22:30:02 +0000 Received: (at 61923) by debbugs.gnu.org; 3 Mar 2023 22:29:53 +0000 Received: from localhost ([127.0.0.1]:34117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYDuP-0008Sg-Oy for submit@debbugs.gnu.org; Fri, 03 Mar 2023 17:29:53 -0500 Received: from mail-pf1-f179.google.com ([209.85.210.179]:40642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYDuL-0008SR-EG for 61923@debbugs.gnu.org; Fri, 03 Mar 2023 17:29:49 -0500 Received: by mail-pf1-f179.google.com with SMTP id x7so527148pff.7 for <61923@debbugs.gnu.org>; Fri, 03 Mar 2023 14:29:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677882580; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=K3NzRa/z8nwvauc5GKYm3RMXelnpWkkeZHv4TZg5MUQ=; b=GN82AKKPXzSv6X51LgoUloT5JWD29aN5FCU4Au6oKrWIQh/1KR2AA723a3U6m3Xf3J TQOD+jbLj8wWIhKRw1HYB5lJ4/F0TfJY+oqjQYBKyKFVs0wJFG8AUI4aM6S25IKab+tM jFGnz/hIi94ZWp9Uwfop2gfgz8r51/AouiZ92ORAJUUS7QDp7ZJ02Ke5tQinRD19ruEo gjGX+v613ZsJRVYe/b6eUgi/KY3rersFIF7RuVHcvnP2NS5gFhVyFhp5zSW8fTJ2Yhhf Zh2OxQKrMWIJAxgGXwXlTksaaKgMG1H/YMnz0tlpxb/aOm3JtF3kRR6jYb4IoPzbDOf2 EW5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677882580; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K3NzRa/z8nwvauc5GKYm3RMXelnpWkkeZHv4TZg5MUQ=; b=3rYa4MsnvQg26CfZYXa+64MYtvqGsmxWjnjhD+DhdT/tw3cMk/7E/Nt5zkMaILxZLT mXYRyUogA0Svp00EKDvV4QG4rrkrlD0A7xWisXe9OSKg15tvjeraHP4aHqcIr13aBGmg kkI4v1S8q5PEg7bNyAy/PilGpRSYaTxdYolKiuLMQoz1WtULZ53lRgsk7xIlRp9HRCjn 8IaexCul+9eI5VzENhRy3Ucz0rQr1/bfUea382N2r2jwM7OJmF5ukxkcLE/cIMVBWJDH QwDWeQvINied4pKz6YwZhGVCcI4Kyp8HyKWurXaeaB+6bkb6XSYAubygHzlVxbCBgwY+ 9RfA== X-Gm-Message-State: AO0yUKXI1bury1xEr2bbJEPnlP+paRltZdHsNnLNRpuzjXadtszmnpil SA5nOE6Akfy4O48SBLkjFWM= X-Google-Smtp-Source: AK7set912N0O4uYlxoF+O+ndNXeFNT0d4qx9RbdQZIn5fo8euWpjiC/y1WA0+G8uZLe1OsrWMVVtcw== X-Received: by 2002:a62:7b94:0:b0:5ce:ef1b:a80 with SMTP id w142-20020a627b94000000b005ceef1b0a80mr3525593pfc.32.1677882579763; Fri, 03 Mar 2023 14:29:39 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id e19-20020a62aa13000000b005b6f63c6cf4sm2111241pff.30.2023.03.03.14.29.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Mar 2023 14:29:39 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Message-Id: <6313B57B-47BB-47D3-94F4-BA0C60FFD913@gmail.com> Date: Fri, 3 Mar 2023 14:29:28 -0800 X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Spam-Score: 0.0 (/) 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 (-) Gleb Zakharov writes: > Eli Zaretskii writes: > >> If you are saying that the indentation inside string is incorrect in >> general, then I agree we should fix it. (I don't use Go.) But then >> please present the reproduction recipe which doesn't use another >> language in the string, but simply has a string, which is corrupted = by >> indentation. > > Yes, it seems to be incorrect in general. Sorry for the misguidance > regarding language embedding, it is just how I noticed the issue. > > Here is a recipe of how to reproduce it for a usual piece of text in a > scratch buffer with `emacs -Q` : > > ``` > /* > (require 'treesit) > (require 'go-ts-mode) > (setq treesit-extra-load-path = '("/home/snyssfx/.guix-home/profile/lib/tree-sitter")) > (go-ts-mode) > */ > > func a() { > _ =3D ` > Lorem ipsum dolor sit amet, > consectetur adipiscing elit, > sed do eiusmod tempor incididunt ut > labore et dolore magna aliqua.` > } > ``` > > If we call M-q anywhere in a function or insert a new line in the > string literal, the text or its part will be indented. However, the > expected behavior is for it to stay as it is. > > Best Regards, > Gleb In general we shouldn=E2=80=99t mess with indentation inside of = multi-line strings, Let me see what go-ts-mode is doing. Yuan From unknown Mon Aug 18 04:42:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Mar 2023 23:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Yuan Fu , snyssfx@posteo.net Cc: Eli Zaretskii , 61923@debbugs.gnu.org Received: via spool by 61923-submit@debbugs.gnu.org id=B61923.16778874679651 (code B ref 61923); Fri, 03 Mar 2023 23:52:02 +0000 Received: (at 61923) by debbugs.gnu.org; 3 Mar 2023 23:51:07 +0000 Received: from localhost ([127.0.0.1]:34227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYFB5-0002Vb-Hf for submit@debbugs.gnu.org; Fri, 03 Mar 2023 18:51:07 -0500 Received: from mail-wr1-f51.google.com ([209.85.221.51]:35782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYFB3-0002V1-7U for 61923@debbugs.gnu.org; Fri, 03 Mar 2023 18:51:05 -0500 Received: by mail-wr1-f51.google.com with SMTP id q16so3793895wrw.2 for <61923@debbugs.gnu.org>; Fri, 03 Mar 2023 15:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677887459; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=4KEHpS9imHkTPlDY5HNJUcwT4qUyvIHNszNZ+7ttx5w=; b=EyqM/z/RAfes4Y6ciwpnPFKfeTTtXChKQuCxy3L6VS95zfjYr+lLMa+HajBEVWpUnN aX0A6B6yiwRb2EsudXg1gNUfjkDZcq4e79XzoXxx0ABK089YVN1KkTR2IPNM7HgLPdWU UBjQBt+do33iPstr7qOOtoYIChuQ0aUzuknwIeDdJBlSSinRnt3WGZDIbQMvOD/Jk30s req/6ZPT6AnTJ2MEuQ0UfjLT+PLxSDckTcFJP8O/vV+VElDyeGjA3p2Ce4ejOVp9+xM3 RpetpkxaDH3xsP5x8XGPAZ9IUxsPyZ5hKePg/IdaOKwqZW3Nyd8NE5I88c++CpWiAuSQ eOSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677887459; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4KEHpS9imHkTPlDY5HNJUcwT4qUyvIHNszNZ+7ttx5w=; b=H3/jJMTrEzHiVW5Lmn8jSYA1rh6yzWly01WXxVjWot8G6l4aifRMeXxuYlLM+dsSEl k8wpKZJR8DtVburP33vyqc1Ch+7jwwuZy7osgSo/Y0qJ8RMvij8zeSwukEq+5syQe2+P cI8vCGbQTz2ZdXLxIIeRSTNo+ldxkxEWXVIfM2RiZP+2dGRMKXC4yjMNt4r6N/mgAy5u A66UmqwP30itRe9iCYtwOCoEUejCexRzzBrKh/4hOGVwWgqtckXZOIxRKUKUhs/tgrFb 4fwOMfd3RWpI/wMOr40uknLmEGBR9Vp8otN2TwH7qrJR7uuO4xlBSrLcpNzyzMagb9Yb ODag== X-Gm-Message-State: AO0yUKXp/J7WtUaSZwhK4gtJzhZ8xbF79GKDO6ObJcuBR/c3q/RIdm7l tzTOoG3PS9clgFqiFiVhl4w= X-Google-Smtp-Source: AK7set9i4Cw645U/G2cnHg7ZUX1VQx7MUnuI9QZTf1Yf7liznOzdA9ZB+25mCbTeXWqBnEHCaCnTOA== X-Received: by 2002:adf:d850:0:b0:2c5:a742:572f with SMTP id k16-20020adfd850000000b002c5a742572fmr2385040wrl.49.1677887459144; Fri, 03 Mar 2023 15:50:59 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id e15-20020a5d594f000000b002c56046a3b5sm3382365wri.53.2023.03.03.15.50.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Mar 2023 15:50:58 -0800 (PST) Message-ID: <1d59dc78-1480-9690-204c-317d552c4b90@yandex.ru> Date: Sat, 4 Mar 2023 01:50:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US References: <877cvz5b0t.fsf@posteo.net> <6313B57B-47BB-47D3-94F4-BA0C60FFD913@gmail.com> From: Dmitry Gutov In-Reply-To: <6313B57B-47BB-47D3-94F4-BA0C60FFD913@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.9 (/) 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.9 (-) On 04/03/2023 00:29, Yuan Fu wrote: > In general we shouldn’t mess with indentation inside of multi-line strings, > Let me see what go-ts-mode is doing. This seems to work: diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index e8f93d14744..1857c67bb82 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -71,6 +71,7 @@ go-ts-mode--indent-rules ((node-is "]") parent-bol 0) ((node-is "}") parent-bol 0) ((node-is "labeled_statement") no-indent) + ((parent-is "raw_string_literal") no-indent) ((parent-is "argument_list") parent-bol go-ts-mode-indent-offset) ((parent-is "block") parent-bol go-ts-mode-indent-offset) ((parent-is "communication_case") parent-bol go-ts-mode-indent-offset) From unknown Mon Aug 18 04:42:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Mar 2023 09:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov Cc: Eli Zaretskii , 61923@debbugs.gnu.org, snyssfx@posteo.net Received: via spool by 61923-submit@debbugs.gnu.org id=B61923.167792211112898 (code B ref 61923); Sat, 04 Mar 2023 09:29:01 +0000 Received: (at 61923) by debbugs.gnu.org; 4 Mar 2023 09:28:31 +0000 Received: from localhost ([127.0.0.1]:35249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYOBr-0003Ly-0W for submit@debbugs.gnu.org; Sat, 04 Mar 2023 04:28:31 -0500 Received: from mail-pl1-f182.google.com ([209.85.214.182]:41955) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYOBp-0003Lk-JG for 61923@debbugs.gnu.org; Sat, 04 Mar 2023 04:28:29 -0500 Received: by mail-pl1-f182.google.com with SMTP id v11so5190431plz.8 for <61923@debbugs.gnu.org>; Sat, 04 Mar 2023 01:28:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677922104; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=IIxU3LHJKqpDxvR3QGF9Ll9n+uRrL3IKzkg4KEyuFXc=; b=XJd4qq9xtHNbylLfOlVLk8r71mBAdRJHrtevmzQYWuKx7JWiaLEE1aZZedQm77C3Zt Fis6RCRBkIvyH18DDMtT+Z2LkxPSvinDCMZTEENeYESpZ/QkhtDfZl3XDR+WrD1zBglS UeqTBAxVlquf94hUMwOEJlc01hDw35SjdmYKPuQFjc/7hXtDtrdMnsvuzmOXCmICDHkH d5r4PYBuFKgnRlnFvXpI1JoyVxt7Gj5kepVSuNfCpoJkKWg9+WgEWxB+ATo0Zh7H0FpM jWM0A8zTnOgt/Tahm5+vD/VRFpbMIBiekm4kwfQk9adm+mpRsoGC2ykYX3ICHudO1f5L GCNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677922104; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IIxU3LHJKqpDxvR3QGF9Ll9n+uRrL3IKzkg4KEyuFXc=; b=SvPYs/2ZqqHh5MI8uthLuXaps9lD0XQkIgb8B+wyD/uaQkhkUQoJFYg6NSf4NLs8bG GLF2co2X7ntAqxm5MdPtUklCQef3XMTbGWRichBIzLKAoPwcLI70yzx3iQ1cOiE0bdTM GJXe3rONS6SvC9+yY/nJbypzPWnpMDpflpgNe7RxWW92xtlTQdBtOdYM1FctGv9Pi1Mu 21R3Be2E0jtaZnM76gT8yEbg2unYPx43QlNsfUHuSUXc4eF50h5VlWdHEelyHyL/No+n x7N+F/BkxVBZbvrBxTQxQ/8iNzpdhBt4+gup3VWcQK7iRupvqUKVSjrhgvJRcG6tQda4 7ugA== X-Gm-Message-State: AO0yUKVJdFHSyDogSwxQlmXF0TlUlUXHa0vyK5PIQ3DYfZ6xz34ZsbjU 46KuLo+XCuStwzkU7EXN0941Uek6twr+nsJz X-Google-Smtp-Source: AK7set/8hmCoM1osRxIL3I9L46cBGrd+SHn+HQ7pxr30uVqH+W5KUSS8/hFApCnQgJNCiCITRh2Vug== X-Received: by 2002:a17:902:ce8f:b0:19e:2495:20d2 with SMTP id f15-20020a170902ce8f00b0019e249520d2mr6142240plg.30.1677922103838; Sat, 04 Mar 2023 01:28:23 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id c1-20020a63d141000000b004dff15fc121sm2830540pgj.36.2023.03.04.01.28.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Mar 2023 01:28:23 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) From: Yuan Fu In-Reply-To: <1d59dc78-1480-9690-204c-317d552c4b90@yandex.ru> Date: Sat, 4 Mar 2023 01:28:13 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <2F96F083-69D6-4292-ACBE-A6EC07FB4398@gmail.com> References: <877cvz5b0t.fsf@posteo.net> <6313B57B-47BB-47D3-94F4-BA0C60FFD913@gmail.com> <1d59dc78-1480-9690-204c-317d552c4b90@yandex.ru> X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Spam-Score: 0.0 (/) 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 (-) > On Mar 3, 2023, at 3:50 PM, Dmitry Gutov wrote: >=20 > On 04/03/2023 00:29, Yuan Fu wrote: >> In general we shouldn=E2=80=99t mess with indentation inside of = multi-line strings, >> Let me see what go-ts-mode is doing. >=20 > This seems to work: >=20 > diff --git a/lisp/progmodes/go-ts-mode.el = b/lisp/progmodes/go-ts-mode.el > index e8f93d14744..1857c67bb82 100644 > --- a/lisp/progmodes/go-ts-mode.el > +++ b/lisp/progmodes/go-ts-mode.el > @@ -71,6 +71,7 @@ go-ts-mode--indent-rules > ((node-is "]") parent-bol 0) > ((node-is "}") parent-bol 0) > ((node-is "labeled_statement") no-indent) > + ((parent-is "raw_string_literal") no-indent) > ((parent-is "argument_list") parent-bol go-ts-mode-indent-offset) > ((parent-is "block") parent-bol go-ts-mode-indent-offset) > ((parent-is "communication_case") parent-bol = go-ts-mode-indent-offset) >=20 Thanks, I made the change accordingly. And it works great! Yuan= From unknown Mon Aug 18 04:42:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation Resent-From: Gleb Zakharov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Mar 2023 17:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , Yuan Fu Cc: Eli Zaretskii , 61923@debbugs.gnu.org Received: via spool by 61923-submit@debbugs.gnu.org id=B61923.167795160727610 (code B ref 61923); Sat, 04 Mar 2023 17:41:02 +0000 Received: (at 61923) by debbugs.gnu.org; 4 Mar 2023 17:40:07 +0000 Received: from localhost ([127.0.0.1]:37665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYVra-0007BG-Oy for submit@debbugs.gnu.org; Sat, 04 Mar 2023 12:40:07 -0500 Received: from mout02.posteo.de ([185.67.36.66]:33645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYVrZ-0007Ah-Gs for 61923@debbugs.gnu.org; Sat, 04 Mar 2023 12:40:05 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 04FD7240113 for <61923@debbugs.gnu.org>; Sat, 4 Mar 2023 18:39:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1677951600; bh=7EXEZd2RUD6tdFy17Hp1yg50JNLTiXI4pQiFKkxoYgk=; h=From:To:Cc:Subject:Date:From; b=R4mNQnFHTsixVl54IpFrR/ru5ikpGEPe5M1k1VPKJEmTQcNpLmjs9mw9PyW4NcGxo ddfPcgo/wEny0ndlHHmVcGH01AgJN+wsyDp1qdwV5jQksiYQp4ah0Gqe107JpV56z3 3PK4JP98a6+cdSOwPLRyEuPvGzEUAClef/eZY+G86nRorvWFDMEBJFiUeJTV7p/Uni cKkRDPWtdl+JjGTDWhsI2MWkN6kikrGp2R9Nq5ANqNYgej24Rd46f255JRfgjoEQrw z1h/Hm6xEnLS+fxpEfFsdTLY0QG8moSnigbROTbswKbdpV6DPpFRJ4eKB32qDfqiO0 odSmwv3tOYnUg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PTXCz07Ckz6tmQ; Sat, 4 Mar 2023 18:39:56 +0100 (CET) From: Gleb Zakharov In-Reply-To: <1d59dc78-1480-9690-204c-317d552c4b90@yandex.ru> References: <877cvz5b0t.fsf@posteo.net> <6313B57B-47BB-47D3-94F4-BA0C60FFD913@gmail.com> <1d59dc78-1480-9690-204c-317d552c4b90@yandex.ru> Date: Sat, 04 Mar 2023 17:39:55 +0000 Message-ID: <87pm9o2z6c.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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 (---) Dmitry Gutov writes: > This seems to work: > > diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el > index e8f93d14744..1857c67bb82 100644 > --- a/lisp/progmodes/go-ts-mode.el > +++ b/lisp/progmodes/go-ts-mode.el > @@ -71,6 +71,7 @@ go-ts-mode--indent-rules > ((node-is "]") parent-bol 0) > ((node-is "}") parent-bol 0) > ((node-is "labeled_statement") no-indent) > + ((parent-is "raw_string_literal") no-indent) > ((parent-is "argument_list") parent-bol go-ts-mode-indent-offset) > ((parent-is "block") parent-bol go-ts-mode-indent-offset) > ((parent-is "communication_case") parent-bol > go-ts-mode-indent-offset) Thank you, it works for me as well! From unknown Mon Aug 18 04:42:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation Resent-From: Jens Schmidt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Nov 2023 15:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 61923@debbugs.gnu.org Received: via spool by 61923-submit@debbugs.gnu.org id=B61923.170101366110180 (code B ref 61923); Sun, 26 Nov 2023 15:48:01 +0000 Received: (at 61923) by debbugs.gnu.org; 26 Nov 2023 15:47:41 +0000 Received: from localhost ([127.0.0.1]:42583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7HMD-0002e7-EC for submit@debbugs.gnu.org; Sun, 26 Nov 2023 10:47:41 -0500 Received: from mr3.vodafonemail.de ([145.253.228.163]:57770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7HMA-0002df-Cl for 61923@debbugs.gnu.org; Sun, 26 Nov 2023 10:47:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-23sep; t=1701013646; bh=947rYg4nRCJt3CBjiVLc/CoxB/x2HH7xZ5NM7vmG13E=; h=From:To:Subject:In-Reply-To:References:Date:Message-ID:User-Agent: Content-Type:From; b=gV2kfaT7tcA8JtJxvqCe4/yjBJ5wUahpwphSIlrLdM4hokuAeB7AJMt9rkiKqPVg8 ++b0YLsTtOgPNG3LWPTwGUwagwIMJoxl3Xqj/Y97ca9FsMnaM6Bf6gMT+wd7t1gatl NcUqwkQMUWR01Af0cEBigqK0kM1PT7NLiuVcXLHo= Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr3.vodafonemail.de (Postfix) with ESMTPS id 4SdY4t24kYz1ygc for <61923@debbugs.gnu.org>; Sun, 26 Nov 2023 15:47:26 +0000 (UTC) Received: from sappc2 (port-83-236-7-18.dynamic.as20676.net [83.236.7.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4SdY4p04CxzHnHm for <61923@debbugs.gnu.org>; Sun, 26 Nov 2023 15:47:18 +0000 (UTC) From: Jens Schmidt In-Reply-To: <87pm9o2z6c.fsf@posteo.net> (Gleb Zakharov's message of "Sat, 04 Mar 2023 17:39:55 +0000") References: <877cvz5b0t.fsf@posteo.net> <6313B57B-47BB-47D3-94F4-BA0C60FFD913@gmail.com> <1d59dc78-1480-9690-204c-317d552c4b90@yandex.ru> <87pm9o2z6c.fsf@posteo.net> Date: Sun, 26 Nov 2023 16:47:18 +0100 Message-ID: <87leakfreh.fsf@vodafonemail.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-purgate-type: clean X-purgate: clean X-purgate-size: 937 X-purgate-ID: 155817::1701013642-A17FB18D-559DE1B3/0/0 X-Spam-Score: -0.7 (/) 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 (-) Gleb Zakharov writes: > Dmitry Gutov writes: > >> This seems to work: >> >> diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el >> index e8f93d14744..1857c67bb82 100644 >> --- a/lisp/progmodes/go-ts-mode.el >> +++ b/lisp/progmodes/go-ts-mode.el >> @@ -71,6 +71,7 @@ go-ts-mode--indent-rules >> ((node-is "]") parent-bol 0) >> ((node-is "}") parent-bol 0) >> ((node-is "labeled_statement") no-indent) >> + ((parent-is "raw_string_literal") no-indent) >> ((parent-is "argument_list") parent-bol go-ts-mode-indent-offset) >> ((parent-is "block") parent-bol go-ts-mode-indent-offset) >> ((parent-is "communication_case") parent-bol >> go-ts-mode-indent-offset) > > Thank you, it works for me as well! It seems that this bug could be closed: AFAICT the fix is installed on master and Gleb was happy with it. From unknown Mon Aug 18 04:42:08 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Gleb Zakharov Subject: bug#61923: closed (Re: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation) Message-ID: References: <05ad3eeb-f756-07dc-6623-8cc1af35955c@gutov.dev> <877cvz5b0t.fsf@posteo.net> X-Gnu-PR-Message: they-closed 61923 X-Gnu-PR-Package: emacs Reply-To: 61923@debbugs.gnu.org Date: Sun, 26 Nov 2023 16:38:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1701016682-16817-1" This is a multi-part message in MIME format... ------------=_1701016682-16817-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 61923@debbugs.gnu.org. --=20 61923: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D61923 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1701016682-16817-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 61923-done) by debbugs.gnu.org; 26 Nov 2023 16:37:18 +0000 Received: from localhost ([127.0.0.1]:42608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7I8D-0004Lk-MF for submit@debbugs.gnu.org; Sun, 26 Nov 2023 11:37:18 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:33503) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7I8A-0004LT-Hv for 61923-done@debbugs.gnu.org; Sun, 26 Nov 2023 11:37:16 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3D8695C00CD; Sun, 26 Nov 2023 11:37:03 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 26 Nov 2023 11:37:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=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:sender:subject:subject:to:to; s=fm3; t= 1701016623; x=1701103023; bh=ZnnU3IacFzMn/uJU/aEVgT7/3iUtrhBNwZJ jHH5dQNo=; b=okpP6iAh1R8sAdMP3DpQ910HRiCh7YbaWx43CCM+R4F8y3bwLzN DbKoUI/JtY6q3FfJrCEcbGEW/oqmyWBXPa+EWiHZyXkogrpgJ/6Zy2yn2gWX0wbx 4X4gj9aHegdGgooY01v+gt3Ib3oasGKT1iXXwdttuEDEaeXgKyP1FF9/uE3lVT5T tvgv0mOyiiZvuD3gwOI6YVbStSJqx9NuXm2+/qd2EnjBLFuCEFJ+Dvr+E1nFjamH 2BOmIid1wULWTY24XY8rkqTyN/Pjx6FSZdIEcgNPRY/5oScDxFxsmDC7neOoZ/Vb HjndSxD9T88w/45FRWc7Q+k2VNE4J54jsfg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1701016623; x= 1701103023; bh=ZnnU3IacFzMn/uJU/aEVgT7/3iUtrhBNwZJjHH5dQNo=; b=i ZQP1Pwny7LZB4kwNoGyw38ppC0cUTLp0c/pVqeiqdkoL0YECX/re6MAjFqFu1r05 R6bR7954qXmy1aNXAFdB3D5yO+l0KMhaSkRGhQnH4OoqdJCgf5mh4tpaTsz6WhTZ WpKUHrBevWYPmNuBc6AxXv6Pmvsmk0FaUguatEZvOy+PKUBkFqiY6xzztkEQ2Fgl MVfRRV99TXT7Nls+turFtReAqSubI9Ey0Spc/6pU6qSWxXZPf5NBApJXSKPa+kAN sA1NeQvsB77c5tl4KwzqdTNmXj0+40QzW7ZM14YuC49M3GjGxNcTd6F7l9rujYo+ zZSDIdoxMZ2fw9k9Qiymw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudehledgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtje ertddtfeejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhu thhovhdruggvvheqnecuggftrfgrthhtvghrnhepgeehtdehudejieetuedttdejkeehje etueekheffuddtjeeuvdefveeuveeiuddunecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 26 Nov 2023 11:37:01 -0500 (EST) Message-ID: <05ad3eeb-f756-07dc-6623-8cc1af35955c@gutov.dev> Date: Sun, 26 Nov 2023 18:37:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#61923: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation Content-Language: en-US To: Jens Schmidt , 61923-done@debbugs.gnu.org References: <877cvz5b0t.fsf@posteo.net> <6313B57B-47BB-47D3-94F4-BA0C60FFD913@gmail.com> <1d59dc78-1480-9690-204c-317d552c4b90@yandex.ru> <87pm9o2z6c.fsf@posteo.net> <87leakfreh.fsf@vodafonemail.de> From: Dmitry Gutov In-Reply-To: <87leakfreh.fsf@vodafonemail.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 61923-done 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.9 (---) Version: 29.1 On 26/11/2023 17:47, Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Gleb Zakharov writes: > >> Dmitry Gutov writes: >> >>> This seems to work: >>> >>> diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el >>> index e8f93d14744..1857c67bb82 100644 >>> --- a/lisp/progmodes/go-ts-mode.el >>> +++ b/lisp/progmodes/go-ts-mode.el >>> @@ -71,6 +71,7 @@ go-ts-mode--indent-rules >>> ((node-is "]") parent-bol 0) >>> ((node-is "}") parent-bol 0) >>> ((node-is "labeled_statement") no-indent) >>> + ((parent-is "raw_string_literal") no-indent) >>> ((parent-is "argument_list") parent-bol go-ts-mode-indent-offset) >>> ((parent-is "block") parent-bol go-ts-mode-indent-offset) >>> ((parent-is "communication_case") parent-bol >>> go-ts-mode-indent-offset) >> Thank you, it works for me as well! > It seems that this bug could be closed: AFAICT the fix is installed on > master and Gleb was happy with it. Closing! ------------=_1701016682-16817-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 Mar 2023 22:20:49 +0000 Received: from localhost ([127.0.0.1]:58563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXrI8-0003nk-O4 for submit@debbugs.gnu.org; Thu, 02 Mar 2023 17:20:49 -0500 Received: from lists.gnu.org ([209.51.188.17]:32800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXmXp-0007PU-PW for submit@debbugs.gnu.org; Thu, 02 Mar 2023 12:16:42 -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 1pXmXp-000256-Jn for bug-gnu-emacs@gnu.org; Thu, 02 Mar 2023 12:16:41 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXmXn-00089z-7m for bug-gnu-emacs@gnu.org; Thu, 02 Mar 2023 12:16:41 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id AC8E0240639 for ; Thu, 2 Mar 2023 18:16:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1677777395; bh=OlMA8QGeyW3D4EuPMK0GCUzWM3slm8msIsBCi/1Raqk=; h=From:To:Subject:Date:From; b=R9uAaVD2Af97VULNuBS9zB1QLyM8k+CLj7zdzm4qPTnhH9+iJjj55HwAvhGkqDShi L3EJl43LZ3y4q4JDFNDbFwx3J3JtRMIsp1G7zllNPhtTnapKuIUCzgz6JQKOv+aRY9 Wx7pEdKBZNPzVIP4nJBtk94wlDFzwLGlUQyAJVR+uA64YYezRJcTabclg7dytn7s9Q DS2JshpP054iwcxL1IuZbSdsW0xX+H6NpaKD9NmjHHs/ls91jiajL+bAi600thjBdn kYYQ2W8Bma3d7heMSwOWtdeulxlQX7asazad4pZ8OMex+fYD6HmCjMH5pMqqdjvhKy cAeTyCcbtmnMg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PSHnv0lgXz9rxM for ; Thu, 2 Mar 2023 18:16:34 +0100 (CET) From: Gleb Zakharov To: bug-gnu-emacs@gnu.org Subject: 30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation Date: Thu, 02 Mar 2023 17:16:34 +0000 Message-ID: <877cvz5b0t.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=snyssfx@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 02 Mar 2023 17:20:46 -0500 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.3 (--) Hi everyone, thank you all for the hard work! In Go, I sometimes work with code written in another language. I embed it into Go as string literals, for example, SQL code. When I type a multiline string, I notice that tree-sitter indents it by usual Go rules, but this feature should be turned off inside the string. How to reproduce the behavior with `emacs -Q`: Paste a text from a snippet below, execute lines in the comments to start `go-ts-mode` and type M-q or M-x prog-fill-reindent-defun RET. The text should stay as it is, but things in a multiline string indented. ``` // (require 'treesit) // (require 'go-ts-mode) // (setq treesit-extra-load-path '("/home/snyssfx/.guix-home/profile/lib/tree-sitter")) // (go-ts-mode) func a() { _ = ` SELECT a FROM b WHERE c; if true { panic("doesn't have to be indented") }` } ``` I tried to add ``` ((node-is "raw-string-literal") point-min) ``` to `go-ts-mode--indent-rules`, but it doesn't seem to fix it. The problem doesn't exist for just string literals, as they must not be multiline. Configured using: 'configure CONFIG_SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash --prefix=/gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87 --enable-fast-install --with-modules --with-cairo --with-native-compilation --disable-build-details' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $EMACSLOADPATH: /home/snyssfx/.guix-home/profile/share/emacs/site-lisp:/home/snyssfx/.guix-home/profile/share/emacs/site-lisp:/gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Go Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /gnu/store/bswj8m0vr5pxxqz596wg1vw0l3vhap56-emacs-transient-20230219.1111/share/emacs/site-lisp/transient-20230219.1111/transient hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/transient /gnu/store/nk42g92xzs9c0406xhkg7fq1iyijcn74-emacs-bind-key-20230203.2004/share/emacs/site-lisp/bind-key-20230203.2004/bind-key hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/bind-key /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-delight hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-delight /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-diminish hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-diminish /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-lint hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-lint /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-bind-key hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-bind-key /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-jump hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-jump /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-ensure hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-ensure /gnu/store/zvamp8ayqg4867dc53mfk0ckjj277ryf-emacs-use-package-20230203.2004/share/emacs/site-lisp/use-package-20230203.2004/use-package-core hides /gnu/store/xa55f4sq86q91l59c5nwmhch75s82icp-emacs-next-29.0.60-0.ac7ec87/share/emacs/30.0.50/lisp/use-package/use-package-core Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date smerge-mode diff-mode easy-mmode diff help-fns radix-tree cl-print byte-opt debug backtrace find-func go-ts-mode treesit cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 97206 10432) (symbols 48 8202 0) (strings 32 23985 1962) (string-bytes 1 788970) (vectors 16 18947) (vector-slots 8 370311 8362) (floats 8 50 38) (intervals 56 629 0) (buffers 984 16)) ------------=_1701016682-16817-1--