From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aleksey Kliger Newsgroups: gmane.emacs.bugs Subject: bug#63379: 29.0.60; Indentation not working properly in csharp-mode Date: Fri, 1 Sep 2023 22:10:18 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000fcdb76060456c74d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15124"; mail-complaints-to="usenet@ciao.gmane.io" To: 63379@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 02 10:25:00 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 1qcLwB-0003gx-Bc for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Sep 2023 10:24:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcLw6-000723-9D; Sat, 02 Sep 2023 04:24:54 -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 1qcLw5-00071f-92 for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 04:24:53 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qcLw5-0005KY-1K for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 04:24:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qcLwE-00056f-L4 for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 04:25:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Aleksey Kliger Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Sep 2023 08:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63379 X-GNU-PR-Package: emacs Original-Received: via spool by 63379-submit@debbugs.gnu.org id=B63379.169364305819553 (code B ref 63379); Sat, 02 Sep 2023 08:25:02 +0000 Original-Received: (at 63379) by debbugs.gnu.org; 2 Sep 2023 08:24:18 +0000 Original-Received: from localhost ([127.0.0.1]:35097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcLvV-00055C-Fb for submit@debbugs.gnu.org; Sat, 02 Sep 2023 04:24:17 -0400 Original-Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:53339) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcG61-0001s2-7x for 63379@debbugs.gnu.org; Fri, 01 Sep 2023 22:10:45 -0400 Original-Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-564b8e60ce9so1799206a12.2 for <63379@debbugs.gnu.org>; Fri, 01 Sep 2023 19:10:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693620629; x=1694225429; darn=debbugs.gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ncG7JwIkkFMfeRz64aNnmMvo7GiPPAv6Qxb7H1xF5Ro=; b=Us+G9nU1uM+MClno3a4JaRBBTcbB9hnBrV60gMBkQW3+QAP0TIyIFJnBEkrabJ9z5+ ysV/M3RC4yIu9LvJDM4pRCL7sIflQJ+RqDAxmwNGA5mJtptCEfPbx66T9bv+nIEzCaig tsdUaP6DDByLOp5WLADvOKRl17ewCmmuErvSYgnuQgHg1gTM1tLG3Pec5rNASczxxRWl Cl58Iu92bx4wOvXmGjV7xxMC6H8GeZKsJGidBR76tP6e6gQVniesW1hp7CJg9BmhNYZl fsoKxs6oonX2YQoeH+yxZPdiNFw0/d4ZXQs6h+mW113vHOZcTl/sh4+zOUHOKlBrBa+Q nu/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693620629; x=1694225429; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ncG7JwIkkFMfeRz64aNnmMvo7GiPPAv6Qxb7H1xF5Ro=; b=e8dupopDewG6L6nZ1QWn8C0bm/MFrYPFPfqQO9Q1OjRXqeoO7CvUmLq03h+q4CriAk pX9xImT60/YT4lEq07C5SgCS1s3cEdG6FIaDGHKgS/rLb7VE+xX1rPA99h0O84WODcBu l6QNd0xkN/W+quDfsoxS6DbqS8WRBpNLZT2/T7FNFZcwjZI1QqfpSBARvwpjwX+n7WxB s797knZjnqJbuvY2ERSua/g0gQYVMMCyxyhdcTjf5yzBisSU793bsgj9KB+ic3wixNz2 Vs0QfphLQ+nqrt5PYMOD0WpL6bhBwC1ZZS+5y6z9p9/u9nIDL3LKoQ6YbfY6DCWvrSNM 8OEg== X-Gm-Message-State: AOJu0YxP8/9Q/uEGbzUCxQsqmIRUp419ZDbuVZaKwqxktu3JliPfy8dd LYpYcyWrBsdlBJk5nm171cQ3RIEqtrQjN4dwRxwLIAIVq6Q= X-Google-Smtp-Source: AGHT+IHp5PclLjosqoxr8phkkeIHBviPAmH9Z+Y7KbAskYChm55om+4w0se2oPyvzqVcX7+1k6E0QkoWXf8xDlqpMsc= X-Received: by 2002:a17:90a:8a12:b0:26d:262e:70be with SMTP id w18-20020a17090a8a1200b0026d262e70bemr3603288pjn.22.1693620629198; Fri, 01 Sep 2023 19:10:29 -0700 (PDT) X-Mailman-Approved-At: Sat, 02 Sep 2023 04:24:13 -0400 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:268968 Archived-At: --000000000000fcdb76060456c74d Content-Type: text/plain; charset="UTF-8" This seems to be due to https://github.com/emacs-mirror/emacs/commit/dfc850ca0223ffd1d2048657ea6d20c971865d51 specifically (backward-up-list 1 t t) seems to emit that error message: ;; Assume called interactively; don't signal an error. (user-error "At top level") Easy reproduction: edit a csharp file, go to some toplevel line (e.g. "using System;" that is pervasive in a lot of C# code) and run c-indent-line-or-region. By the way: (advice-add 'c-guess-basic-syntax :around #'csharp-guess-basic-syntax) means that csharp-guess-basic-syntax runs also in all other c-mode derived modes. So this error also happens if you first edit a .cs file and then a normal .c file and you try to, for example, indent a toplevel comment in the C code. Very frustrating. -Aleksey --000000000000fcdb76060456c74d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This seems to be due to=C2=A0https:= //github.com/emacs-mirror/emacs/commit/dfc850ca0223ffd1d2048657ea6d20c97186= 5d51

specifically=C2=A0(backward-up-list 1 t t) seem= s to emit that error message:

=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Assume called interactively; don'= ;t signal an error.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (user-error "At top level")


=
Easy reproduction: edit a csharp file, go to some toplevel line = (e.g. "using System;" that is pervasive in a lot of C# code) and = run c-indent-line-or-region.


By the= way: (advice-add 'c-guess-basic-syntax :around #'csharp-guess-basi= c-syntax)=C2=A0
means that csharp-guess-basic-syntax runs also in= all other c-mode derived modes.=C2=A0 So this error also happens if you fi= rst edit a .cs file and then a normal .c file and you try to, for example, = indent a toplevel comment in the C code.=C2=A0 Very frustrating.
=
-Aleksey

--000000000000fcdb76060456c74d--