From 84cdff894b6c96e5d15acf08d3dbe75e2f6b37b2 Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Fri, 24 Jan 2003 18:48:41 +0000 Subject: [PATCH] Added another version contributed by Jason Rumney git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1372 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd-emacs/src/elisp/jrumney_pmd.el | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pmd-emacs/src/elisp/jrumney_pmd.el diff --git a/pmd-emacs/src/elisp/jrumney_pmd.el b/pmd-emacs/src/elisp/jrumney_pmd.el new file mode 100644 index 0000000000..d1d70e427b --- /dev/null +++ b/pmd-emacs/src/elisp/jrumney_pmd.el @@ -0,0 +1,34 @@ +(require 'compile) + +(defgroup pmd nil "PMD" + :group 'emacs) + +(defcustom pmd-java-home "/usr/local/bin/java" + "Java binary to run PMD with." + :type 'file + :group 'pmd ) + +(defcustom pmd-home "~/pmd" + "Directory where PMD is installed." + :type 'directory + :group 'pmd) + +(defcustom pmd-rulesets "rulesets/basic.xml" + "Rulesets to apply" + :type 'string + :group 'pmd) + +(add-to-list 'compilation-error-regexp-alist + '("\\([a-zA-Z]:?[-a-zA-Z._0-9\\\\/]+\\)\t\\([0-9]+\\)\t[^\n]+" 1 2)) + +(defun pmd-current-buffer () + "Run PMD on the contents of the current buffer." + (interactive) + (let ((file-name (buffer-file-name) ) + (pmd-buffer-create (get-buffer "*PMD*")) + (pmd-jar (concat pmd-home "/lib/pmd-1.01.jar"))) + (compile (concat pmd-java-home " -cp " pmd-jar + " net.sourceforge.pmd.PMD " + file-name " text " pmd-rulesets )))) + +(provide 'pmd)