From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jen-Chieh Shen Newsgroups: gmane.emacs.bugs Subject: bug#63141: Incorrect indentation in csharp-mode Date: Sat, 29 Apr 2023 04:59:52 -0700 Message-ID: References: <83354ksb73.fsf@gnu.org> <875y9ge6gu.fsf@thornhill.no> <87zg6scomn.fsf@thornhill.no> <83y1mcqoyl.fsf@gnu.org> <87wn1wcj6s.fsf@thornhill.no> <87ttx0cj04.fsf@thornhill.no> <83jzxvqlz6.fsf@gnu.org> <83cz3nqkl5.fsf@gnu.org> <77880442-05AB-40CC-ABA5-DDC40AC4413A@thornhill.no> <83ttwzotex.fsf@gnu.org> <91689035-9CEF-49C9-A525-478D96F60620@thornhill.no> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000074096005fa785461" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39243"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63141@debbugs.gnu.org, Eli Zaretskii , jostein@kjonigsen.net To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 29 14:01:31 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1psjGd-0009zq-53 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Apr 2023 14:01:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1psjGC-0000cF-6l; Sat, 29 Apr 2023 08:01: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 1psjGA-0000bk-KE for bug-gnu-emacs@gnu.org; Sat, 29 Apr 2023 08:01:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1psjGA-0001ny-Bb for bug-gnu-emacs@gnu.org; Sat, 29 Apr 2023 08:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1psjGA-0004DU-1f for bug-gnu-emacs@gnu.org; Sat, 29 Apr 2023 08:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jen-Chieh Shen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Apr 2023 12:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63141 X-GNU-PR-Package: emacs Original-Received: via spool by 63141-submit@debbugs.gnu.org id=B63141.168276961416139 (code B ref 63141); Sat, 29 Apr 2023 12:01:02 +0000 Original-Received: (at 63141) by debbugs.gnu.org; 29 Apr 2023 12:00:14 +0000 Original-Received: from localhost ([127.0.0.1]:35364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psjFN-0004CF-Hi for submit@debbugs.gnu.org; Sat, 29 Apr 2023 08:00:14 -0400 Original-Received: from mail-lf1-f53.google.com ([209.85.167.53]:46560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psjFJ-0004As-Sw for 63141@debbugs.gnu.org; Sat, 29 Apr 2023 08:00:12 -0400 Original-Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-4edc7cc6f46so1082489e87.1 for <63141@debbugs.gnu.org>; Sat, 29 Apr 2023 05:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682769603; x=1685361603; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8QfVvPrGKwcs5gRQ3XNTOb88sXEOKTd9vNZoc5Jb26Y=; b=TuBUyCpXWdJSjsQJ3iwyekuSPV1/SuEIQBQfTTqr+wSjAOVH5mMts7cOXlPqPAh14b syydxAweSbv0do/9RMPOt1cTYBrW4q2gYTQBz/fOvTRFMEi0roULKMqlR2z8fWn8enU8 Sn2MZUmPqq80mIdENZ0ftoATNfoeC6P0iA4cT7ja2cOcWvxAuRHo3vrPKEHJv5P5Wt99 pXSBTXWBkY/UMA1IOWP2nkYflzVIf14lRMuWQfufUHfSYgJe/3v/mR97p/bsHuzCO/s7 Bk4vhVujBaPXq1JbbhETRb5Ryk7KT3/Wty3DVsW6EgYgzxvCqh+Rb/8Wykm5ioqy1C06 fotA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682769603; x=1685361603; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8QfVvPrGKwcs5gRQ3XNTOb88sXEOKTd9vNZoc5Jb26Y=; b=k0jR3+rleja1iz3v+V5c8NtEbdbn8Z5K8Z+4yvan5ghgb3Vl6xq3B60CfC5r1VlRBX YBtl94RRPSMgcDJGHH/mgpyHbqWWhqgzjRyf/4kXJV1uiZWhPM8MclZoGhxmiFET5oL/ uq/k04pd37I76kkqmJ1qo59BsiWFaqYWeJodQA7DGM4CXKBN2Qejg8wkjmCK2IPwdARV 125+PIT8ITZzKeopPYI5cWuYcJLLpA8qV4qSlEIGqXh6Ol85tTQJwyYpYl1RkR/QzjrT QDNe3a22TZhXq3SQNUlRQyDi/hgD22Sa9c0o+aLxk+u+KWVubWpboKoHHx3uiJxWJeXp sGmw== X-Gm-Message-State: AC+VfDxn+OeUQYgWM9G7JEub679eMC0MqHB5MyiuFRqyf76n4r5DqE5x scdjr+UR0QreK60h501c1A9mbOjCOn7SsWY+PDE= X-Google-Smtp-Source: ACHHUZ7UcBCOc1fVBZoxLgruFC1CJvB4xPYSyzj2BNMSXxDA3gsLW5TfrERzSxsVXNsH+CzXY0tv/5L0Vh9xO/Gfqm8= X-Received: by 2002:ac2:4186:0:b0:4ed:b4f9:28c7 with SMTP id z6-20020ac24186000000b004edb4f928c7mr2179646lfh.6.1682769603462; Sat, 29 Apr 2023 05:00:03 -0700 (PDT) In-Reply-To: <91689035-9CEF-49C9-A525-478D96F60620@thornhill.no> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260816 Archived-At: --00000000000074096005fa785461 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > I'm open to changing the default alist. Are you open to devising such a patch? Sorry, I don=E2=80=99t have the knowledge to provide an appropriate patch. = :( Thanks for opening it to change the default settings, though. On Sat, Apr 29, 2023 at 4:54 AM Theodor Thornhill wrote= : > > > On 29 April 2023 13:00:59 CEST, Jen-Chieh Shen > wrote: > >> The patch I can envision is to change the default c-offsets-alist. > >But IMO we should only do that if many/most C# programs use the style > >suggested by the OP. > > > >Just want to mention, the style conflicts with Visual Studio IDE (probab= ly > >VSCode too), and Microsoft creates C#. It's probably a good idea to matc= h > >with these tool. > > > >I don't know what=E2=80=99s the prefer C# style guides in the old days, = but I=E2=80=99ve > >been using C# 8+ years and I know it has always been this way (the one > with > >expected behavior). > > > >LMKWYT? > > > > I'm open to changing the default alist. Are you open to devising such a > patch? > > Theo > > > > >On Sat, Apr 29, 2023 at 3:48 AM Eli Zaretskii wrote: > > > >> > Date: Sat, 29 Apr 2023 12:40:30 +0200 > >> > From: Theodor Thornhill > >> > CC: 63141@debbugs.gnu.org, jostein@kjonigsen.net > >> > > >> > >> (c-add-style "csharp" > >> > >> '("java" > >> > >> (c-basic-offset . 4) > >> > >> (c-comment-only-line-offset . (0 . 0)) > >> > >> (c-offsets-alist . ((inline-open . 0) > >> > >> (arglist-intro . +) > >> > >> (arglist-close . 0) > >> > >> (inexpr-class . 0) > >> > >> (case-label . +) > >> > >> (cpp-macro . > >> c-lineup-dont-change) > >> > >> (substatement-open . 0))))= ) > >> > >> ``` > >> > >> > >> > >> I consider it an awkward indentation, so better to change the > default > >> (change to the expected > >> > >> behavior). > >> > > > >> > >I'll let Theo and Jostein chime in regarding the accepted practices > in > >> > >C#, but in general it is not enough to hear from one or several use= rs > >> > >that they don't like the defaults in order for us to change the > >> > >default behavior. These customization options exist precisely so > that > >> > >people who don't like the defaults could easily adjust Emacs to the= ir > >> > >liking. Why would you impose your personal preferences on everyone > >> > >else, instead of letting them customize this as they see fit? > >> > > >> > I agree. It's not a bug, but could absolutely be a missing > >> feature/consideration. I'd be happy to review a patch with the propose= d > >> changes, though. > >> > >> The patch I can envision is to change the default c-offsets-alist. > >> But IMO we should only do that if many/most C# programs use the style > >> suggested by the OP. > >> > --00000000000074096005fa785461 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
>=C2=A0I'm ope= n to changing the default alist. Are you open to devising such a patch?

=
Sorry, I don=E2=80=99t hav= e the knowledge to provide an appropriate patch. :(

Thanks for opening it to change the default se= ttings, though.=C2=A0

On Sat, Apr 29, 2023 at 4:54 AM Theodor Th= ornhill <theo@thornhill.no> = wrote:


On 29 April 2023 13:00:59 CEST, Jen-Chieh Shen <jcs090218@gmail.com> wrote:
>> The patch I can envision is to change the default c-offsets-alist.=
>But IMO we should only do that if many/most C# programs use the style >suggested by the OP.
>
>Just want to mention, the style conflicts with Visual Studio IDE (proba= bly
>VSCode too), and Microsoft creates C#. It's probably a good idea to= match
>with these tool.
>
>I don't know what=E2=80=99s the prefer C# style guides in the old d= ays, but I=E2=80=99ve
>been using C# 8+ years and I know it has always been this way (the one = with
>expected behavior).
>
>LMKWYT?
>

I'm open to changing the default alist. Are you open to devising such a= patch?

Theo

>
>On Sat, Apr 29, 2023 at 3:48 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
>> > Date: Sat, 29 Apr 2023 12:40:30 +0200
>> > From: Theodor Thornhill <theo@thornhill.no>
>> > CC: 63141@debbugs.gnu.org, jostein@kjonigsen.net
>> >
>> > >> (c-add-style "csharp"
>> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '= ;("java"
>> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (c-basic-offset . 4)
>> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (c-comment-only-line-offset . (0 . 0))
>> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (c-offsets-alist . ((inline-open=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0. 0)
>> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= arglist-intro=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0. +)
>> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= arglist-close=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0. 0)
>> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= inexpr-class=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 . 0)
>> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= case-label=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 . +)
>> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= cpp-macro=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.
>> c-lineup-dont-change)
>> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= substatement-open=C2=A0 =C2=A0 =C2=A0. 0)))))
>> > >> ```
>> > >>
>> > >> I consider it an awkward indentation, so better to c= hange the default
>> (change to the expected
>> > >> behavior).
>> > >
>> > >I'll let Theo and Jostein chime in regarding the acce= pted practices in
>> > >C#, but in general it is not enough to hear from one or s= everal users
>> > >that they don't like the defaults in order for us to = change the
>> > >default behavior.=C2=A0 These customization options exist= precisely so that
>> > >people who don't like the defaults could easily adjus= t Emacs to their
>> > >liking.=C2=A0 Why would you impose your personal preferen= ces on everyone
>> > >else, instead of letting them customize this as they see = fit?
>> >
>> > I agree. It's not a bug, but could absolutely be a missin= g
>> feature/consideration. I'd be happy to review a patch with the= proposed
>> changes, though.
>>
>> The patch I can envision is to change the default c-offsets-alist.=
>> But IMO we should only do that if many/most C# programs use the st= yle
>> suggested by the OP.
>>
--00000000000074096005fa785461--