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: Sat, 25 Mar 2023 16:18:57 +0000 Message-ID: <87sfdsx0r2.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> 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="6126"; 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 To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 25 17:18:13 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 1pg6ar-00017e-He for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Mar 2023 17:18:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pg6Zk-0002Zf-7c; Sat, 25 Mar 2023 12:17:04 -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 1pg6Zi-0002Yl-PQ for emacs-devel@gnu.org; Sat, 25 Mar 2023 12:17:02 -0400 Original-Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pg6Zf-0000rm-3o; Sat, 25 Mar 2023 12:17:00 -0400 Original-Received: by mail-ed1-x52f.google.com with SMTP id er18so8236881edb.9; Sat, 25 Mar 2023 09:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679761016; 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=J4loI0zyY0qOFN+CC7mtRj9GJfkZAp5DPTpABqAVsAY=; b=PGWC1d+ip9KHQHyG/vwsm4tpEmqIn68MEqrRfETsLN4Hjfw0GqH42+FVukennDvFEA IFCXiXrYzu6Bhoj5bYUNBt4lpx1m314w6QCHg9B/BaGfk3p/h0UP5gAewa9J4V5E5a0q OUdzS4xGjP5TmcEmMLWAo6+pf7PtjoI7u/dEx98OHrhVxQh34JY5G1s0GUgFESlYRFoL nq+pFzF6VwxT8Ke/2ol38i/I7KPbuK7/OH8jcZn4pQrHFHxfkVWeGJ0flXzP8VWZOjzz trR85kmOy6ewhB53fQ9AepWb3ainf7EV6OhArnBnzQR8SjpPP4Jd6mwEvaAzeZKtHv+v QxHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679761016; 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=J4loI0zyY0qOFN+CC7mtRj9GJfkZAp5DPTpABqAVsAY=; b=UJCykK3UNt4JOJO/rSBA6TuXa+4hilmvrmy2BmJYPXw4UHy27VEA+QthhHYi68ny9a s4W9EvRpo/J9i69fLniy5CH3mvU2XNl2IZKxZR01yefLJMIcFDWE3PZnD/PppmVOx6tv t/M/6p8y+L6f4cgNerv2A33tcu1zhZ8mK1LaNUFMWKHP+6Mm1OrI6lUc+7m/1ZyH+qj/ BYVL2w2b7uQ+UwooVxFfiELjpLf+DwxkY+vzq0cCndwFDJnwhz97VcJx2mn3Pa5UbsDx m/TAenAwBm3hqZDU6RXfEShUnWzk5JMDuR0AuEsD1VTVbG6H2Exh6BlXegfdi22Kis4c Jv8A== X-Gm-Message-State: AAQBX9dZ5Ce9xTb1hlBRN6tJ2NSEX7H0GGwOdJe9x4/t0kHz/P24uAMg uXVAqzGacicyIQDYUqrFtYLdzmJFS2c= X-Google-Smtp-Source: AKy350Z5VLO2W1s9l18gS1yeeKV4ygEJP9w1y/v9K55SrwkEax4ZC+tCwPq0/irbBKUKFT0N24EcIQ== X-Received: by 2002:a17:906:4413:b0:8b1:2d7f:ed57 with SMTP id x19-20020a170906441300b008b12d7fed57mr7099709ejo.42.1679761015761; Sat, 25 Mar 2023 09:16:55 -0700 (PDT) Original-Received: from krug (87-196-74-168.net.novis.pt. [87.196.74.168]) by smtp.gmail.com with ESMTPSA id g17-20020a170906c19100b00921c608b737sm11885912ejz.126.2023.03.25.09.16.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Mar 2023 09:16:55 -0700 (PDT) In-Reply-To: <83v8ioc2ou.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 25 Mar 2023 17:42:41 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=joaotavora@gmail.com; helo=mail-ed1-x52f.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:304765 Archived-At: Eli Zaretskii writes: >> Date: Sat, 25 Mar 2023 14:42:50 +0200 >> Cc: Daniel Colascione , Yuan Fu , >> emacs-devel@gnu.org >> From: Dmitry Gutov >>=20 >> > I don't think this problem has anything to do with tree-sitter. It >> > would happen just as well in regular c++-mode if electric-indent-mode >> > were on by default there (but it isn't). >>=20 >> The mode is globally on by default, but indeed the contents of=20 >> electric-indent-chars are much shorter there. >>=20 >> > So it's just the fact that electric-indent-mode is on by default >> > _and_ c-ts-mode.el does this: >> >=20 >> > (setq-local electric-indent-chars (append "{}():;,#" electric-indent-c= hars)) >> >=20 >> > so people are getting what the mode author (and Emacs defaults) ask fo= r: >> > electric indentation doing its thing. >>=20 >> Good point: perhaps either this list should be revisited, or predicated= =20 >> (at runtime) somehow on electric-pair-mode being enabled. > > Maybe the list of electric characters should be a defcustom? Maybe, but then major-modes like c++-ts-mode shouldn't mess with it. Or do you mean a electric-indent-chars-for-c++-ts-mode-specifically defcustom. If so, that's a bit odd. What if the user then also wants to set electric-indent-chars herself? 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. Jo=C3=A3o