Home Home > 2012 > 08 > 31 > Editing KIWI configurations with Emacs
Sign up | Login

Deprecation notice: openSUSE Lizards user blog platform is deprecated, and will remain read only for the time being. Learn more...

Editing KIWI configurations with Emacs

August 31st, 2012 by

I recently decided to do all my work in emacs and even though the learning speed is a bit slow, I thought I would share what I discoverd regarding editing the KIWI config files. Kiwi has the schema file for the elements and their attributes but unfortunately by default Emacs is unaware of it’s schema location. So first create a schema location file as below and save it.

<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
<transformURI fromPattern="*.xml" toPattern="*.rnc"/>

<uri pattern=”*.kiwi” typeId=”KIWI”/>
<typeId id=”KIWI” uri=”/usr/share/kiwi/modules/KIWISchema.rnc”/>
</locatingRules>

I saved it as $HOME/.emacs.d/data/myschemas.xml. Now add this to your Emac’s init file for autoloading the nxml mode for kiwi files in addition to the xml files

(setq auto-mode-alist
(cons '("\\.\\(xml\\|kiwi\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
auto-mode-alist))

and add this code for nxml mode to locate the kiwi schema file when you edit a kiwi config file

(eval-after-load 'rng-loc
'(add-to-list 'rng-schema-locating-files (concat user-emacs-directory "data/myschemas.xml")))

Now have fun with Emacs, Kiwi and your openSUSE

Both comments and pings are currently closed.

Comments are closed.