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#63379: 29.0.60; Indentation not working properly in csharp-mode Date: Sat, 02 Sep 2023 19:17:12 +0200 Message-ID: <878r9oa413.fsf@thornhill.no> References: <83il8t9cir.fsf@gnu.org> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2298"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63379@debbugs.gnu.org To: Eli Zaretskii , Aleksey Kliger Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 02 19:18: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 1qcUGH-0000Q9-Bo for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Sep 2023 19:18:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcUG1-0008BL-NT; Sat, 02 Sep 2023 13:18:01 -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 1qcUFu-0008B5-8I for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 13:17:54 -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 1qcUFr-0003sx-Tz for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 13:17:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qcUG1-0005Ng-OM for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 13:18:01 -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, 02 Sep 2023 17:18:01 +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.169367504820648 (code B ref 63379); Sat, 02 Sep 2023 17:18:01 +0000 Original-Received: (at 63379) by debbugs.gnu.org; 2 Sep 2023 17:17:28 +0000 Original-Received: from localhost ([127.0.0.1]:38543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcUFU-0005Mx-3i for submit@debbugs.gnu.org; Sat, 02 Sep 2023 13:17:28 -0400 Original-Received: from out-232.mta1.migadu.com ([95.215.58.232]:52827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcUFQ-0005Mn-WD for 63379@debbugs.gnu.org; Sat, 02 Sep 2023 13:17:26 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1693675034; 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: in-reply-to:in-reply-to:references:references; bh=wm9mlubek2VSxBquGpHA+09czXnEnocpp2DO7+8ix+g=; b=P7tzbHahUSJRxAj+rOZ4pQ6qa+imRMdqvLIU/VQUNxG69PRYNPr88U8xuxCjc7lx0wVyLm vDa2mpMKxUSQBDrmmKWOqz3wzo5xEAhm0INsoMvqxD2EA0SbSQu0SB1CZMOgOy6Vqjrfe6 0DyCMFw+MoPUAADucN/LVxTkp299sVtj/xjMU1XIZczAegjwskrpj6y1GFprOyj7iKwQ2k 5RG15IZFNn2K4AVYs8zD/4uHyHTZm25+dQs39HAnyLI58AlmPcZa1JQyf/a+649ekPLArm ZKbpzunVW4m18p5xQdw0ZXk75GNE6oGKx0kVkLJd1IlLQzATjR2HabUsA0ABhQ== In-Reply-To: <83il8t9cir.fsf@gnu.org> 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:269034 Archived-At: Eli Zaretskii writes: >> From: Aleksey Kliger >> Date: Fri, 1 Sep 2023 22:10:18 -0400 >> >> This seems to be due to >> https://github.com/emacs-mirror/emacs/commit/dfc850ca0223ffd1d2048657ea6d20c971865d51 > > You mean, you haven't updated your Git since February? > >> 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. > > Theo, could you please look into this? TIA. > Yeah, I think this is a simple enough fix. Should I install this on master, 29 branch? diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 37bb84ab5ba..1e5cb20bda9 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -493,7 +493,7 @@ csharp-guess-basic-syntax ;; Next non-whitespace character should be '{' (goto-char (c-point 'boi)) (unless (eq (char-after) ?{) - (backward-up-list 1 t t)) + (ignore-errors (backward-up-list 1 t t))) (save-excursion ;; 'new' should be part of the line (goto-char (c-point 'iopl)) Theo