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, 6 May 2023 12:05:32 -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> <85E96551-13EE-4DAA-8DFB-8190CDE68E7A@thornhill.no> <83zg6mnb6o.fsf@gnu.org> <83cz3dhmhn.fsf@gnu.org> <877ctlhj4s.fsf@thornhill.no> <724DBB6A-7037-415E-A258-88613A7A49B8@thornhill.no> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000aa0e3805fb0b170e" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5889"; 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 May 06 21:06:17 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 1pvNEW-0001KK-97 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 May 2023 21:06:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvNEJ-0003ms-GH; Sat, 06 May 2023 15:06:03 -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 1pvNEI-0003mY-As for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 15:06: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 1pvNEI-0007Bx-2W for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 15:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pvNEH-0004fj-Oy for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 15:06:01 -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, 06 May 2023 19:06:01 +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.168339995317945 (code B ref 63141); Sat, 06 May 2023 19:06:01 +0000 Original-Received: (at 63141) by debbugs.gnu.org; 6 May 2023 19:05:53 +0000 Original-Received: from localhost ([127.0.0.1]:35768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvNE8-0004fN-TP for submit@debbugs.gnu.org; Sat, 06 May 2023 15:05:53 -0400 Original-Received: from mail-lj1-f176.google.com ([209.85.208.176]:61637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvNE6-0004f9-Bz for 63141@debbugs.gnu.org; Sat, 06 May 2023 15:05:51 -0400 Original-Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2ac8c0fbb16so18914721fa.2 for <63141@debbugs.gnu.org>; Sat, 06 May 2023 12:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683399944; x=1685991944; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ECUsu/IKfsNaPXqBa1MSJjFkhfSCTyrdjIDIdOyq16A=; b=p3bRkrjJcUt/LQTGcexolY/s7EnG/Km1hUKxihoxCYA3CDVv63JALwhn0Ra0KcNN1G 0cx91DcXKoxDbtD56Tnl+l+/bmuuug2xJZ5W08RBGHSiV7ODwNTqff2kEgimHGmK+EXY 7VTNBumeyKajCMe7fG9sfXqtRXRgFHvHnbLMhCSPB9ltXMH22rRmKvwJUCht06b4vmEA h6Yb7XyiPgiNSJQi5nwYj4CEodESMKV2t2E+ExbXUl63Fvaro4aDnw7Xzsoow0xSBD+M ypnyNl7TR2y+Ikw4uywK4xtJwlyK1uW1Z6KsdubKvUqXE0KogZOGGKCZp+ge9XI0bbM7 ufMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683399944; x=1685991944; 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=ECUsu/IKfsNaPXqBa1MSJjFkhfSCTyrdjIDIdOyq16A=; b=ZtMuYfa7V4oiVek+UgyzxgIKM3eHl5EwKfDun6d74dG1gP7SKs2w9OJqlWjoMiAwdA Z8Z6DoZz0q3C9WCEiQqXgMAju2kaBYN6OuiFSTGBsd7KL6YXwuUqzDpNtX/tyfBuhWlR BGS9RjWsfVy7UyabpmoudVRVfQTRQAoh25bMoyCouLyzHNAgoA1nBF3VLeYfe4GTmEpM GCLJRX2ymCcKX4BnzGol0AkrdZKGKOLuD572HHIaji5NDY3fLCMcZBE6sfz/oUOd3SdD 02Fn4CkBTDvwQk6CIOGvi4+ZiJwrynG+rRiLULmsqkO8t0DhU98a+gMHvAKajTvMPPoX jACQ== X-Gm-Message-State: AC+VfDxbXDlg54alJgYaTET3/nqoR2r0lUYrnVe4ZknCLxG9LI9EhiGo dy5fJULsiFsRzH/j1wy+ZaYeZCFqKw+712ZZxD8= X-Google-Smtp-Source: ACHHUZ6PjXB84Q/qsGDqPttZ7f1LC+md8mTrta+kJPKOUxBoUE7GyesgmoOqz5ZFCFkWBoE3rEeLhixPyKQvBy7eFq0= X-Received: by 2002:ac2:5110:0:b0:4f2:34f1:cf24 with SMTP id q16-20020ac25110000000b004f234f1cf24mr199362lfb.22.1683399943784; Sat, 06 May 2023 12:05:43 -0700 (PDT) In-Reply-To: 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:261212 Archived-At: --000000000000aa0e3805fb0b170e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > It should be, yes, but not yet the one I just sent. I'll install that later today :) Sounds good! Thank you so much for your effort! Jen-Chieh On Sat, May 6, 2023 at 5:05 AM Theodor Thornhill wrote: > > > On 6 May 2023 13:09:58 CEST, Jen-Chieh Shen wrote: > >Oh, I haven't pulled the latest so I guess it's fixed? > > > >On Sat, May 6, 2023 at 4:08 AM Theodor Thornhill > wrote: > > > >> > > > It should be, yes, but not yet the one I just sent. I'll install that > later today :) > > Theo > > >> > >> On 6 May 2023 13:00:31 CEST, Jen-Chieh Shen > wrote: > >> >> Thanks! > >> >> > >> >> Jen-Chieh, can you test this? > >> >> > >> >> Theo > >> > > >> >Yes! It works! Thank you! > >> > > >> >How about the fix for the attribute? > >> > > >> >Jen-Chieh > >> > >> Isn't that fix already on emacs-29? > >> > >> > >> > > >> >On Sat, May 6, 2023 at 3:03=E2=80=AFAM Theodor Thornhill > >> wrote: > >> > > >> >> Eli Zaretskii writes: > >> >> > >> >> >> Date: Wed, 03 May 2023 06:44:47 +0200 > >> >> >> From: Theodor Thornhill > >> >> >> CC: jcs090218@gmail.com, 63141@debbugs.gnu.org, > >> jostein@kjonigsen.net > >> >> >> > >> >> >> > >> >> >> > >> >> >> On 2 May 2023 14:57:03 CEST, Eli Zaretskii wrote: > >> >> >> >> Date: Sat, 29 Apr 2023 13:02:12 +0200 > >> >> >> >> From: Theodor Thornhill > >> >> >> >> CC: jcs090218@gmail.com, 63141@debbugs.gnu.org, > >> >> jostein@kjonigsen.net > >> >> >> >> > >> >> >> >> >> 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. > >> >> >> >> > >> >> >> >> Agreed :) > >> >> >> > > >> >> >> >So, what's the way forward here? do we change the defaults? > >> >> >> > >> >> >> I think so. Ill try to get to it today :) > >> >> > > >> >> > Ping! > >> >> > >> >> Thanks! > >> >> > >> >> Jen-Chieh, can you test this? > >> >> > >> >> diff --git a/lisp/progmodes/csharp-mode.el > >> b/lisp/progmodes/csharp-mode.el > >> >> index 4f7cbc3d51d..869a207c567 100644 > >> >> --- a/lisp/progmodes/csharp-mode.el > >> >> +++ b/lisp/progmodes/csharp-mode.el > >> >> @@ -464,6 +464,15 @@ csharp-at-lambda-header > >> >> > >> >> (defun csharp-guess-basic-syntax (orig-fun &rest args) > >> >> (cond > >> >> + (;; enum > >> >> + (save-excursion > >> >> + (goto-char (c-point 'boi)) > >> >> + (and > >> >> + (eq (char-after) ?\{) > >> >> + (save-excursion > >> >> + (goto-char (c-point 'iopl)) > >> >> + (looking-at ".*enum.*")))) > >> >> + `((class-open ,(c-point 'iopl)))) > >> >> (;; Attributes > >> >> (save-excursion > >> >> (goto-char (c-point 'iopl)) > >> >> > >> >> Theo > >> >> > >> > --000000000000aa0e3805fb0b170e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
>=C2=A0It should be, ye= s, but not yet the one I just sent. I'll install that later today :)

Sounds good! Thank you so= much for your effort!

= Jen-Chieh

On Sat, May 6, 2023 at 5:05 AM Theodor Thornhill <<= a href=3D"mailto:theo@thornhill.no">theo@thornhill.no> wrote:


On 6 May 2023 13:09:58 CEST, Jen-Chieh Shen <jcs090218@gmail.com> wrote:
>Oh, I haven't pulled the latest so I guess it's fixed?
>
>On Sat, May 6, 2023 at 4:08 AM Theodor Thornhill <theo@thornhill.no> wrote:
>
>>


It should be, yes, but not yet the one I just sent. I'll install that l= ater today :)

Theo

>>
>> On 6 May 2023 13:00:31 CEST, Jen-Chieh Shen <jcs090218@gmail.com> wrote: >> >>=C2=A0 Thanks!
>> >>
>> >>=C2=A0 =C2=A0 Jen-Chieh, can you test this?
>> >>
>> >>=C2=A0 Theo
>> >
>> >Yes! It works! Thank you!
>> >
>> >How about the fix for the attribute?
>> >
>> >Jen-Chieh
>>
>> Isn't that fix already on emacs-29?
>>
>>
>> >
>> >On Sat, May 6, 2023 at 3:03=E2=80=AFAM Theodor Thornhill <<= a href=3D"mailto:theo@thornhill.no" target=3D"_blank">theo@thornhill.no= >
>> wrote:
>> >
>> >> Eli Zaretskii <eliz@gnu.org> writes:
>> >>
>> >> >> Date: Wed, 03 May 2023 06:44:47 +0200
>> >> >> From: Theodor Thornhill <theo@thornhill.no>
>> >> >> CC: jcs090218@gmail.com, 63141@debbugs.gnu.org,
>> jostein= @kjonigsen.net
>> >> >>
>> >> >>
>> >> >>
>> >> >> On 2 May 2023 14:57:03 CEST, Eli Zaretskii <<= a href=3D"mailto:eliz@gnu.org" target=3D"_blank">eliz@gnu.org> wrote= :
>> >> >> >> Date: Sat, 29 Apr 2023 13:02:12 +0200 >> >> >> >> From: Theodor Thornhill <theo@thornhill.no>
>> >> >> >> CC: jcs090218@gmail.com, 63141@debbugs.gnu.org,
>> >> jostein@kjonigsen.net
>> >> >> >>
>> >> >> >> >> I agree. It's not a bug, b= ut 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 chan= ge the default
>> c-offsets-alist.
>> >> >> >> >But IMO we should only do that if m= any/most C# programs use the
>> >> style
>> >> >> >> >suggested by the OP.
>> >> >> >>
>> >> >> >> Agreed :)
>> >> >> >
>> >> >> >So, what's the way forward here? do we c= hange the defaults?
>> >> >>
>> >> >> I think so. Ill try to get to it today :)
>> >> >
>> >> > Ping!
>> >>
>> >> Thanks!
>> >>
>> >> Jen-Chieh, can you test this?
>> >>
>> >> diff --git a/lisp/progmodes/csharp-mode.el
>> b/lisp/progmodes/csharp-mode.el
>> >> index 4f7cbc3d51d..869a207c567 100644
>> >> --- a/lisp/progmodes/csharp-mode.el
>> >> +++ b/lisp/progmodes/csharp-mode.el
>> >> @@ -464,6 +464,15 @@ csharp-at-lambda-header
>> >>
>> >>=C2=A0 (defun csharp-guess-basic-syntax (orig-fun &res= t args)
>> >>=C2=A0 =C2=A0 (cond
>> >> +=C2=A0 =C2=A0(;; enum
>> >> +=C2=A0 =C2=A0 (save-excursion
>> >> +=C2=A0 =C2=A0 =C2=A0 (goto-char (c-point 'boi))
>> >> +=C2=A0 =C2=A0 =C2=A0 (and
>> >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0(eq (char-after) ?\{)
>> >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursion
>> >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(goto-char (c-point &#= 39;iopl))
>> >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(looking-at ".*en= um.*"))))
>> >> +=C2=A0 =C2=A0 `((class-open ,(c-point 'iopl))))
>> >>=C2=A0 =C2=A0 =C2=A0(;; Attributes
>> >>=C2=A0 =C2=A0 =C2=A0 (save-excursion
>> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char (c-point 'iopl)= )
>> >>
>> >> Theo
>> >>
>>
--000000000000aa0e3805fb0b170e--