From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: Missing features in c-ts-mode Date: Thu, 16 Feb 2023 20:14:26 +0100 Message-ID: <87ilg1qv71.fsf@thornhill.no> References: <83wn4iajyy.fsf@gnu.org> <87fsb67pfj.fsf@thornhill.no> <83lekyagwy.fsf@gnu.org> <87a61e7n5j.fsf@thornhill.no> <877cwi7mju.fsf@thornhill.no> <83bkluaevv.fsf@gnu.org> <871qmq7l9q.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16249"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 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 Thu Feb 16 20:15: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 1pSjiq-000407-JT for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Feb 2023 20:15:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSjiS-0008Ew-9F; Thu, 16 Feb 2023 14:14:48 -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 1pSjiQ-0008BD-6n for emacs-devel@gnu.org; Thu, 16 Feb 2023 14:14:46 -0500 Original-Received: from out-98.mta0.migadu.com ([91.218.175.98]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSjiO-0001h6-0k for emacs-devel@gnu.org; Thu, 16 Feb 2023 14:14:45 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1676574868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cXszXR5NhAAt1uNHzmU4imzDDEy/Fk/PRHZ5jeUlQRc=; b=QlITVz+MCLdhTeRzRKeIAoxxrOOiKDwSw54Nb9OOh3XEhJdnLFQMu9JtFaErcToLzKTIZH lipI3EXwkkXFypke3+FvnWzmCwqF6NNW4uLI0cfGiPZQPspTCQ7/ALH3LWJFcMr8DMymDX aUTXE9Ie89NS2bawkTlmZ2LWtWCsGJQmz0k3lkrutXNRysLw3kJb0kwBQT6rxJZ1HJlTc6 3y+j6gSJ4x+l9vq/riij2zKlhmaGmxnLPlnUbL5WSb5Vq7wO4EGIyZXvMN1wbxB6kWvfSt a6sCkGKysAvsPWQzVGfUpco3DT3fwbxmfDr3OwGubBUOICLHY6E58ZwLFd2yYA== In-Reply-To: <871qmq7l9q.fsf@thornhill.no> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=91.218.175.98; envelope-from=theo@thornhill.no; helo=out-98.mta0.migadu.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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:303433 Archived-At: Theodor Thornhill writes: > Eli Zaretskii writes: > >>> From: Theodor Thornhill >>> Cc: casouri@gmail.com, emacs-devel@gnu.org >>> Date: Wed, 15 Feb 2023 20:31:33 +0100 >>> >>> This patch adds some support for this- but I'm not really satisfied yet. >>> It will electrically indent if you've typed "#i", or if you insert "#" >>> before say, "if". The reason it behaves this way right now is that the >>> parser returns an (ERROR (ERROR)) node when only # is inserted. I'll >>> see if I can find some workaround for it. >> >> Thank you for working on this. Now done. I believe the fix was small enough to go to emacs-29, so just pushed. What would be the best way to create a test that would emulate this behavior? I tried ``` Code: (lambda () (c-ts-mode) (self-insert-command 1 "#")) Point-Char: | Name: Electric pound indents to column 0 =-= int main (void) { | return 0; } =-= int main (void) { #| return 0; } =-=-= ``` But that didn't run the electric indent afaict. Theo