[Mono-list] Editor frustration.

Miguel de Icaza miguel@ximian.com
01 Aug 2001 02:59:58 -0400


> Amused, yes, but I'd rather be writing code.  Could somebody enlighten me as
> how to either switch the mode (I assume cc-mode will work reasonably well
> for C#) or bind a mode to a file's extension?

I use this on Emacs, dunno if this works on XEmacs:

(defun fix-java-mode ()
  (define-key java-mode-map "\C-m" 'newline-and-indent)
  (custom-set-variables '(c-basic-offset 8)))

(add-hook 'java-mode-hook 'fix-java-mode)

(setq auto-mode-alist (cons '("\\.cs\\'" . java-mode) auto-mode-alist))

Although I saw someone had a much better `java' default than the
above, and I plan on trying it out ;-)