unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>, Aleksey Kliger <akliger@gmail.com>
Cc: 63379@debbugs.gnu.org
Subject: bug#63379: 29.0.60; Indentation not working properly in csharp-mode
Date: Sat, 02 Sep 2023 19:17:12 +0200	[thread overview]
Message-ID: <878r9oa413.fsf@thornhill.no> (raw)
In-Reply-To: <83il8t9cir.fsf@gnu.org>

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Aleksey Kliger <akliger@gmail.com>
>> 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





  parent reply	other threads:[~2023-09-02 17:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-08 17:47 bug#63379: 29.0.60; Indentation not working properly in csharp-mode Jen-Chieh Shen
2023-05-18 21:52 ` Yuan Fu
2023-05-19  2:09   ` Jen-Chieh Shen
2023-09-02  2:10 ` Aleksey Kliger
2023-09-02  8:59   ` Eli Zaretskii
2023-09-02 11:14     ` Aleksey Kliger
2023-09-02 17:17     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-09-02 17:20       ` Eli Zaretskii
     [not found]         ` <875y4sa35m.fsf@thornhill.no>
2023-09-02 18:03           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878r9oa413.fsf@thornhill.no \
    --to=bug-gnu-emacs@gnu.org \
    --cc=63379@debbugs.gnu.org \
    --cc=akliger@gmail.com \
    --cc=eliz@gnu.org \
    --cc=theo@thornhill.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).