;; ;; SGML editing mode courtesy of PSGML ;; (autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t) (autoload 'xml-mode "psgml" "Major mode to edit XML files." t) ;; ;; Misc PSGML settings ;; (setq-default sgml-indent-data t) (setq sgml-validate-command "rxp -xVs %s %s" sgml-auto-activate-dtd t sgml-omittag nil sgml-shortag nil sgml-always-quote-attributes t sgml-minimize-attributes nil sgml-auto-insert-required-elements t sgml-tag-region-if-active t sgml-live-element-indicator t sgml-indent-step 2 sgml-indent-data t sgml-set-face (eq 'x window-system) ) ;; ;; PSGML Font-lock faces ;; (if (eq 'x window-system) (setq sgml-markup-faces '((start-tag . font-lock-keyword-face) (end-tag . font-lock-keyword-face) (ignored . font-lock-string-face) (ms-start . font-lock-other-type-face) (ms-end . font-lock-other-type-face) (shortref . bold) (entity . font-lock-reference-face) (comment . font-lock-comment-face) (pi . font-lock-other-emphasized-face) (sgml . font-lock-function-name-face) (doctype . font-lock-emphasized-face)))) ;; ;; Associate CNXML and style sheet files with PSGML ;; (setq auto-mode-alist (append (list (cons "\\.cnxml" 'xml-mode)) auto-mode-alist)) (setq auto-mode-alist (append (list (cons "\\.xsl$" 'xml-mode)) auto-mode-alist)) ;; ;; Set emacs for UTF-8 encoding ;; (setq locale-coding-system 'utf-8) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) (prefer-coding-system 'utf-8) ;; We don't use this one because it seems to mess up copy/paste on X ;; (set-selection-coding-system 'utf-8)