Skip to content

Commit fbe090b

Browse files
authored
Merge pull request #263 from emacs-csharp/feature/stefan-patch
Implement patch from Stefan Monnier <monnier@iro.umontreal.ca>
2 parents 18fea21 + 2215140 commit fbe090b

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

csharp-mode.el

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; csharp-mode.el --- C# mode derived mode -*- lexical-binding: t; -*-
22

3-
;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
3+
;; Copyright (C) 2020-2022 Free Software Foundation, Inc.
44

55
;; Author : Theodor Thornhill <theo@thornhill.no>
66
;; Maintainer : Jostein Kjønigsen <jostein@gmail.com>
@@ -68,12 +68,16 @@
6868
(eval-and-compile
6969
(c-add-language 'csharp-mode 'java-mode))
7070

71+
(defun csharp--make-mode-syntax-table ()
72+
(let ((table (make-syntax-table)))
73+
(c-populate-syntax-table table)
74+
(modify-syntax-entry ?@ "_" table)
75+
table))
76+
(defvar csharp--make-mode-syntax-table #'csharp--make-mode-syntax-table
77+
"Workaround for Emacs bug#57065.")
78+
7179
(c-lang-defconst c-make-mode-syntax-table
72-
csharp `(lambda ()
73-
(let ((table (make-syntax-table)))
74-
(c-populate-syntax-table table)
75-
(modify-syntax-entry ?@ "_" table)
76-
table)))
80+
csharp #'csharp--make-mode-syntax-table)
7781

7882
(c-lang-defconst c-identifier-syntax-modifications
7983
csharp (append '((?@ . "w"))
@@ -563,14 +567,14 @@ compilation and evaluation time conflicts."
563567

564568
(defvar csharp-mode-syntax-table
565569
(funcall (c-lang-const c-make-mode-syntax-table csharp))
566-
"Syntax table used in csharp-mode buffers.")
570+
"Syntax table used in `csharp-mode' buffers.")
567571

568572
(defvar csharp-mode-map
569573
(let ((map (c-make-inherited-keymap)))
570574
map)
571-
"Keymap used in csharp-mode buffers.")
575+
"Keymap used in `csharp-mode' buffers.")
572576

573-
(easy-menu-define csharp-mode-menu csharp-mode-map "C# Mode Commands"
577+
(easy-menu-define csharp-mode-menu csharp-mode-map "C# Mode Commands."
574578
(cons "C#" (c-lang-const c-mode-menu csharp)))
575579

576580
;;;###autoload

0 commit comments

Comments
 (0)