Flymake for RELAX NG compact syntax

Inasmuch as the Wisent parsing and other CEDET/Speedbar/Semantic goodness for RELAX NG compact syntax files that I’m currently working on may not be ready for prime time for a while, here’s something to add to your .emacs so `flymake' runs Jing in the background to find syntax errors in your RELAX NG compact syntax files:

(require 'flymake)
(defun flymake-rnc-init ()
  (let* ((temp-file (flymake-init-create-temp-buffer-copy
		     'flymake-create-temp-inplace))
     	 (local-file (file-relative-name
		      temp-file
		      (file-name-directory buffer-file-name))))
    (list "jing" (list "-c" local-file))))
(add-to-list 'flymake-allowed-file-name-masks
      '(".+\\.rnc$"
	flymake-rnc-init
	flymake-simple-cleanup
	flymake-get-real-file-name))
(add-hook 'rnc-mode-hook
	  'flymake-mode)

2 thoughts on “Flymake for RELAX NG compact syntax

  1. And is flymake a part of standard emacs please…
    (I didn’t even know that jing could validate compact syntax!)

    Thanks Tony

  2. Yes, flymake is part of standard Emacs. You could also try `flyspell-mode' for on-the-fly spelling checking.

Comments are closed.