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: Fri, 17 Feb 2023 18:34:34 +0100 Message-ID: <437CB8E1-1BBA-42A8-BADE-9F729A7AC5CA@thornhill.no> References: <87fsb67pfj.fsf@thornhill.no> <83lekyagwy.fsf@gnu.org> <87a61e7n5j.fsf@thornhill.no> <877cwi7mju.fsf@thornhill.no> <83bkluaevv.fsf@gnu.org> <871qmq7l9q.fsf@thornhill.no> <87ilg1qv71.fsf@thornhill.no> <20230217082935.waa7f473dmvbpg3d@Ergus> <87fsb4r4xf.fsf@thornhill.no> <83k00g1o0k.fsf@gnu.org> <20230217163747.yt5kizq6e4vqmqqe@Ergus> 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="34327"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, emacs-devel@gnu.org To: Ergus , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 17 18:35:18 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 1pT4dh-0008hT-F7 for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Feb 2023 18:35:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pT4dC-0005Bp-OF; Fri, 17 Feb 2023 12:34:46 -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 1pT4dB-0005BS-8z for emacs-devel@gnu.org; Fri, 17 Feb 2023 12:34:45 -0500 Original-Received: from out2.migadu.com ([188.165.223.204]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pT4d9-0002S5-AP; Fri, 17 Feb 2023 12:34:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1676655278; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zt8D6Ikdgb5pKqyoYROFYcujqkz3jSUdilxl9utzOGs=; b=xd17HYNkH5E25eDwFT5hR0rpDiyPFqRfrvLYxXro5bXR2yjOjgKoD3LwoUAk1oYt66MIyQ hLg43FXp2BWk3FIirIWc1xWGs+hsAioZm4zGwijodGQVB/c8lTzCF1gtrX1DruBPZNJfki 7cpF7M9fqbl3T8RLgSFKJpJgKJvLKHr+Puu1wM3VAeOWeDhJD1AcNgAFvLTI9AmKPqOBhA 9balq3Z4o2lubHtMW6/Rtg4FmCtMKewgR6b5JJBoKTJlnh1X7A41jSPzvCf25jCgncsEFN Avn5+62tADkTJIR/ievj3frHX2IoOam8zAapje3zKnb/s8y7r45horrgFDaPiw== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: <20230217163747.yt5kizq6e4vqmqqe@Ergus> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=188.165.223.204; envelope-from=theo@thornhill.no; helo=out2.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_PASS=-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:303506 Archived-At: On 17 February 2023 17:37:47 CET, Ergus wrote: >Hi Eli and Theo: > >Yes, I know that the feature is not very "popular" to be enabled by >default, but for parallel programming models based on pragmas (OpenMP, >OmpSs, OpenACC) it is very important=2E > >Many people in my previous work moved to some other editor after years >using emacs due to these apparently "small" details=2E Every time they >wanted to indent a portion of code (i=2Ee they added an if around it), al= l >the pragmas moved out of their place and needed manual fix=2E > >On that moment I commented with Alan the possibility to make #pragma a >syntactc symbol which we could control its indentation like anything >else in c-mode (with +, ++, -, 0 or [0])=2E But he said that it required >too many changes to implement that and offered this "toggle" solution >good enough for me=2E > >I will open the feature request in a moment, but just wanted to comment >the alternative solution more consistent and without an extra mode; >because maybe that way may be simpler now in the new mode?? > >Best, >Ergus > >On Fri, Feb 17, 2023 at 02:20:59PM +0200, Eli Zaretskii wrote: >>> From: Theodor Thornhill >>> Cc: Eli Zaretskii , casouri@gmail=2Ecom, emacs-devel@g= nu=2Eorg >>> Date: Fri, 17 Feb 2023 10:56:28 +0100 >>>=20 >>> > #pragma parallel for first private(x) \ >>> > shared(y) etc >>> > for (=2E=2E=2E) { >>> > =2E=2E=2E=2E >>> > } >>> > } >>> > >>> > In this case the pragma in column zero is very confusing=2E Alan add= ed a >>> > new mode (c-toggle-cpp-indent-to-body) which worked around this issu= e a >>> > few years ago=2E I don't if it is possible to enable similar behavio= r with >>> > your change? Is is? >>> > >>> > Best, >>> > Ergus >>> > >>>=20 >>> It's absolutely possible, but IMO that sounds like an improvement for >>> emacs 30, maybe? >>=20 >> It depends on how simple and safe the change will be=2E But yes, I'm >> okay with delaying this to Emacs 30 if the addition is complex enough= =2E >>=20 >> Thanks=2E >>=20 Would this mean you'd want all preproc directives configurable, or only so= me in particular? I think a defcustom for either/or is doable for Emacs 29,= but for granular control we'd need to think a bit more=2E c-ts-mode-preproc-indent-to-body?