* lisp/progmodes/flymake.el (flymake-xml-program): New option.
authorGlenn Morris <rgm@gnu.org>
Tue, 14 May 2013 02:42:17 +0000 (22:42 -0400)
committerGlenn Morris <rgm@gnu.org>
Tue, 14 May 2013 02:42:17 +0000 (22:42 -0400)
(flymake-xml-init): Use it.

lisp/ChangeLog
lisp/progmodes/flymake.el

index 29231c7..7500252 100644 (file)
@@ -1,5 +1,8 @@
 2013-05-14  Glenn Morris  <rgm@gnu.org>
 
+       * progmodes/flymake.el (flymake-xml-program): New option.
+       (flymake-xml-init): Use it.
+
        * term/xterm.el: Provide a feature.
 
        * term/sup-mouse.el: Move to obsolete/.  Provide a feature.
index 0eb59bd..79bccd1 100644 (file)
@@ -257,6 +257,13 @@ are the string substitutions (see `format')."
   :version "23.1"
   :group 'tools)
 
+(defcustom flymake-xml-program
+  (if (executable-find "xmlstarlet") "xmlstarlet" "xml")
+  "Program to use for XML validation."
+  :type 'file
+  :group 'flymake
+  :version "24.4")
+
 (defcustom flymake-allowed-file-name-masks
   '(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-simple-make-init)
     ("\\.xml\\'" flymake-xml-init)
@@ -1852,7 +1859,9 @@ Use CREATE-TEMP-F for creating temp copy."
 
 ;;;; xml-specific init-cleanup routines
 (defun flymake-xml-init ()
-  (list "xml" (list "val" (flymake-init-create-temp-buffer-copy 'flymake-create-temp-inplace))))
+  (list flymake-xml-program
+        (list "val" (flymake-init-create-temp-buffer-copy
+                     'flymake-create-temp-inplace))))
 
 (provide 'flymake)