bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#63141: Incorrect indentation in csharp-mode


From: Theodor Thornhill
Subject: bug#63141: Incorrect indentation in csharp-mode
Date: Sat, 29 Apr 2023 13:54:11 +0200


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 (probably
>VSCode too), and Microsoft creates C#. It's probably a good idea to match
>with these tool.
>
>I don't know what’s the prefer C# style guides in the old days, but I’ve
>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"
>> > >>              '("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 users
>> > >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 their
>> > >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 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 style
>> suggested by the OP.
>>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]