chiark / gitweb /
el/dot-emacs.el: Use define-derived-mode to make C# mode.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 23 Oct 2009 15:46:04 +0000 (16:46 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 23 Oct 2009 15:46:04 +0000 (16:46 +0100)
This way actually does the fontification right.

el/dot-emacs.el

index 751f3ed2651a2a2354dd890626a572dfa84c17a9..f7cadd9831904cb668cae01ac494bb5903a5660f 100644 (file)
@@ -1229,13 +1229,8 @@ (defun mdw-fontify-csharp ()
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
                 '(0 mdw-punct-face))))))
 
-(defun csharp-mode ()
-  (interactive)
-  (java-mode)
-  (setq major-mode 'csharp-mode)
-  (setq mode-name "C#")
-  (mdw-fontify-csharp)
-  (run-hooks 'csharp-mode-hook))
+(define-derived-mode csharp-mode java-mode "C#"
+  "Major mode for editing C# code.")
 
 ;;;--------------------------------------------------------------------------
 ;;; Awk programming configuration.