emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 e205f68717e: Fix indent for enums in csharp-mode


From: Theodor Thornhill
Subject: emacs-29 e205f68717e: Fix indent for enums in csharp-mode
Date: Sat, 6 May 2023 15:15:56 -0400 (EDT)

branch: emacs-29
commit e205f68717e960a929e5657e8351ba6ef0e5f480
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Theodor Thornhill <theo@thornhill.no>

    Fix indent for enums in csharp-mode
    
    * lisp/progmodes/csharp-mode.el (csharp-guess-basic-syntax): Check for
    keywords containing 'enum' on the line before an opening bracket, and
    make it behave like a class-open token.
---
 lisp/progmodes/csharp-mode.el | 9 +++++++++
 1 file changed, 9 insertions(+)

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 @@ compilation and evaluation time conflicts."
 
 (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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]