From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: treesit indentation "blinking" Date: Tue, 28 Mar 2023 23:11:05 +0100 Message-ID: <87lejgsf0m.fsf@gmail.com> References: <87h6ucik61.fsf@dancol.org> <0F406D08-56D4-4B21-B94D-A47681606911@gmail.com> <1870bcadd28.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> <1870cce6690.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> <35A837A9-59B4-4F1F-A5FA-8483C8024D76@gmail.com> <187104f6b48.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> <21d018e5-a730-12e3-f97c-fffa4f646ccf@yandex.ru> <83v8ioc2ou.fsf@gnu.org> <87sfdsx0r2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7767"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Dmitry Gutov , dancol@dancol.org, casouri@gmail.com, emacs-devel@gnu.org, theo@thornhill.no To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 29 00:10:04 2023 Return-path: Envelope-to: ged-emacs-devel@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 1phHVz-0001s1-EP for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Mar 2023 00:10:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phHVB-0007Rm-62; Tue, 28 Mar 2023 18:09:13 -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 1phHV9-0007RZ-Ob for emacs-devel@gnu.org; Tue, 28 Mar 2023 18:09:11 -0400 Original-Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phHV8-0006eE-5Q; Tue, 28 Mar 2023 18:09:11 -0400 Original-Received: by mail-wm1-x32a.google.com with SMTP id o24-20020a05600c511800b003ef59905f26so8411878wms.2; Tue, 28 Mar 2023 15:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680041348; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=POS7iQzpaMV2N0BXiWoKGTSiJU8EMIUlqzhGHBf6cPo=; b=MRWSt4UugFaDc2CzKXATuaDyQiC+1yt5/RZ4FK8GsH+Df6nQWnQivDeFfcDl1W8jHS utKagRO6ye9OV33Nx00NxlkLilVIWCLYAdXxaC0Ai21FJ6Nfl4GDT2tPL60zcrJRuAi6 ZAEDKdHAGxBXdOtFsnaLnhF99UCbRt47K2Y5YKdkCBmEdHd4AcaWqzFYVsKO60M9gFE9 zATqMWqFuMjt0xaCon3rFjklcVdn6qQXKh4o7OPvM2N2oMyy9Gflo7dYIOMYujSgEbc4 06SrBDRNPSt9ep5qDu+0eSTuLR10F2xhh6+vtXfj4bHM6qmPcD+AUKiA9mjxF/rxBKr+ J6+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680041348; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=POS7iQzpaMV2N0BXiWoKGTSiJU8EMIUlqzhGHBf6cPo=; b=cBXh/dXv9q+sYNJ4gWd5P7/ceLHz95VKKwXFfpDEss+J3ptp/UfjH4VJqUZdiYH1fK oNdn2f9aaKUR4SHV9Ml23JeU67/Jk/FvF7BvSJfTfJ2NUrHinzs9wz3bf9GfPCOAKvx1 mNi+BLr3pQtXheJcg2QHJinWj2kUYS9flXOuz0wP9MVBJbyo667N47wcjb4dQnsXJ2se YWiJ4gwK23MC+Yhnq7IEK7MsW9HiqQLbnaBWlbfJxxhMEIPkr8gjm9x2kFVUBchR8ipu FvbUu4cRc5PB/nix8BClS6g7HfqAN2HmTbdDIwxwOUjHava0coLfaxPE9TnySGXYtIcd Lb8Q== X-Gm-Message-State: AO0yUKUYX0W4oieqBE3o2X7zkpRq6L7ur/sj50GRoFzR9tF07hOt0S8Z vDEMIxNZYx3ylfDhpszXZ7U= X-Google-Smtp-Source: AK7set97koMsB/5bdx02xIqIYlI8SH3PO0HsrUOOlJ2Xcoi+MGzVU/hOOwMMlpCZ+k14WSUDcXDJ+A== X-Received: by 2002:a7b:c8d0:0:b0:3eb:39e7:35fe with SMTP id f16-20020a7bc8d0000000b003eb39e735femr12864719wml.30.1680041347561; Tue, 28 Mar 2023 15:09:07 -0700 (PDT) Original-Received: from krug (87-196-72-128.net.novis.pt. [87.196.72.128]) by smtp.gmail.com with ESMTPSA id z15-20020a05600c220f00b003ef5f77901dsm63153wml.45.2023.03.28.15.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 15:09:06 -0700 (PDT) In-Reply-To: <87sfdsx0r2.fsf@gmail.com> (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vor?= =?utf-8?Q?a=22's?= message of "Sat, 25 Mar 2023 16:18:57 +0000") Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=joaotavora@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304811 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > I think it's easier that c++-ts-mode doesn't touch that variable at all > and leave it set to "\n". I can't see it being much use, with or > without electric-pair-mode in the mix. Following up on this, I have now tried c++-ts-mode for a while now and can confirm this jumping-around-while-typing is terrible without electric-pair-mode, and still pretty bad even with electric-pair-mode. Here's just an example with emacs -Q + electric-pair-mode + c++-ts-mode Start typing i n t SPC m a i n ( ) SPC { RET The buffer becomes int main() { <- point here } So far so good. Point is correctly indented at column 2 (because electric-pair-mode has balanced the buffer and electric-indent-mode did its thing on RET). Type 'std'. Nothing surpising happens, good. Now type one ':' and see the 'std:' be electrically indented to column 1, type the other ':' and the 'std::' now jumps to column 2 again. In bug#62412, Theo said is was OK with killing the custom setting of electric-indent-chars in c-ts-mode.el and leave it set to the default. Though a number of indenting problems would remain after that, at least this one clear annoyance would be solved. So if there are no objections, I propose to apply this patch. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 59eb9fc23e6..88360716381 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -956,10 +956,6 @@ c-ts-base-mode ;; Comment (c-ts-common-comment-setup) =20 - ;; Electric - (setq-local electric-indent-chars - (append "{}():;,#" electric-indent-chars)) - ;; Imenu. (setq-local treesit-simple-imenu-settings (let ((pred #'c-ts-mode--defun-valid-p)) In master? In emacs-29? Jo=C3=A3o