Emacs General

Open With Mode

Add file extensions to open with a special mode:

(add-to-list 'auto-mode-alist
             (cons (concat "\\." (regexp-opt '("axvw" "xml" "xsd" "sch" "rng" "xslt" "svg" "rss") t) "\\'")
                   'nxhtml-mode))

Tab

Setup Tab Width

Edit the part you setup your custom-set-variables:

(custom-set-variables
 '(tab-width 4)
 '(c-basic-offset tab-width)
 '(nxml-child-indent tab-width)
 '(css-indent-offset tab-width)
 '(indent-tabs-mode nil tab-width)
 '(mumamo-submode-indent-offset tab-width)
)

XML

Installing the plugin

see http://www.xmlhack.com/read.php?item=2061

Download the plugin nxml-mode-20041004.tar.gz from: http://www.thaiopensource.com/download/

Unpack it to ~./xemacs/nxml/

~./xemacs/init.el
;; add xml to load-path
(setq load-path (cons (concat (aw-make-package-path "nxml") my-dir-sep) load-path))

;; XML
(load "rng-auto.el")
(setq auto-mode-alist
      (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
	    auto-mode-alist))

Realtime checks in Emacs

At first we need to convert the xml-schema file into a rnc file. For this download the program trang-20030619.zip from: http://www.thaiopensource.com/download/

Execute it with:

java -jar trang.jar -I xml -O rnc ui.xsd test.rnc

Now you can load the file test.rnc with emacs from the menu XML->Set Schema->File…

UTF8

Check for Correct Coding

find /usr/local/share/munin/plugins/ -type f | while read f ; do echo "Checking $f" ; uniname -V $f ; done

Set Coding to UTF-8

C-x RET c utf-8 RET C-x C-s