From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#63141: Incorrect indentation in csharp-mode Date: Sat, 06 May 2023 13:08:13 +0200 Message-ID: <724DBB6A-7037-415E-A258-88613A7A49B8@thornhill.no> 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> Reply-To: Theodor Thornhill 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="38320"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63141@debbugs.gnu.org, Eli Zaretskii , jostein@kjonigsen.net To: Jen-Chieh Shen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 06 13:09:18 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 1pvFmv-0009lb-Qc for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 May 2023 13:09:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvFmi-0001pN-Uq; Sat, 06 May 2023 07:09: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 1pvFmg-0001p1-FW for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 07:09: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 1pvFmg-0008Dg-7M for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 07:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pvFmg-0001v8-2Y for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 07:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 May 2023 11:09: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.16833713027330 (code B ref 63141); Sat, 06 May 2023 11:09:02 +0000 Original-Received: (at 63141) by debbugs.gnu.org; 6 May 2023 11:08:22 +0000 Original-Received: from localhost ([127.0.0.1]:59532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvFm1-0001uA-LN for submit@debbugs.gnu.org; Sat, 06 May 2023 07:08:22 -0400 Original-Received: from out-63.mta1.migadu.com ([95.215.58.63]:38317) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvFlx-0001tu-2x for 63141@debbugs.gnu.org; Sat, 06 May 2023 07:08:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1683371295; 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=Ahu/o6KGeSNosh2/g2OWa9jDKpiq1JyBI5pitw05RQU=; b=wx7YlDiEVRZ8x577Od9OReNScgaNR/GySFLOpAE1bWZJoYFqDbSZBVARHh4ihiSTP3thtQ IuoR0z1UFI+YKJbakqBDJ3uvj4+77QyxilmTm6uGXMEvDQDiT6HhoFuPXLmxO3XAlOjb+3 uoCWcGDelnd9V0ukH4BAOSSrzXJaqUoY8JByY+3aBX7FFhCOcPmeYagKXtsd+WP2dSTaxA K6DscF7GsXT4ulRojwwpSV6MuQWZm63+6AMCOq8CVYrttMFNd7HynvyebwDuU06d8M4vFT 5yhGLdpRKk2xzunr2qauFdil7wvWTNY+eDg3Y1S4ZQb0RGW5oY8ymzwKz2+59Q== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: X-Migadu-Flow: FLOW_OUT 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:261180 Archived-At: 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=2Ecom, 63141@debbugs=2Egnu=2Eorg, jostein@kjonig= sen=2Enet >> >> >> >> >> >> >> >> 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=2Ecom, 63141@debbugs=2Egnu=2Eorg, >> jostein@kjonigsen=2Enet >> >> >> >> >> >> >> I agree=2E It's not a bug, but could absolutely be a missing >> feature/consideration=2E I'd be happy to review a patch with the propos= ed >> changes, though=2E >> >> >> > >> >> >> >The patch I can envision is to change the default c-offsets-alis= t=2E >> >> >> >But IMO we should only do that if many/most C# programs use the >> style >> >> >> >suggested by the OP=2E >> >> >> >> >> >> Agreed :) >> >> > >> >> >So, what's the way forward here? do we change the defaults? >> >> >> >> I think so=2E Ill try to get to it today :) >> > >> > Ping! >> >> Thanks! >> >> Jen-Chieh, can you test this? >> >> diff --git a/lisp/progmodes/csharp-mode=2Eel b/lisp/progmodes/csharp-mo= de=2Eel >> index 4f7cbc3d51d=2E=2E869a207c567 100644 >> --- a/lisp/progmodes/csharp-mode=2Eel >> +++ b/lisp/progmodes/csharp-mode=2Eel >> @@ -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 "=2E*enum=2E*")))) >> + `((class-open ,(c-point 'iopl)))) >> (;; Attributes >> (save-excursion >> (goto-char (c-point 'iopl)) >> >> Theo >>