└── mvn-help.el /mvn-help.el: -------------------------------------------------------------------------------- 1 | ;;; mvn-help.el --- maven help tools 2 | 3 | ;; Copyright (C) 2013 Nic Ferrier 4 | 5 | ;; Author: Nic Ferrier 6 | ;; Keywords: languages, processes 7 | ;; Created: 28th March 2013 8 | ;; Version: 0.0.1 9 | 10 | ;; This program is free software; you can redistribute it and/or modify 11 | ;; it under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation, either version 3 of the License, or 13 | ;; (at your option) any later version. 14 | 15 | ;; This program is distributed in the hope that it will be useful, 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;; GNU General Public License for more details. 19 | 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with this program. If not, see . 22 | 23 | ;;; Commentary: 24 | 25 | ;; Some stuff to help with the Maven build tool for Java. 26 | 27 | ;;; Code: 28 | 29 | ;;;###autoload 30 | (defun mvn-buffer-init () 31 | "Initialize a buffer. 32 | 33 | Use this as a hook function in java-mode." 34 | (make-variable-buffer-local 'compile-command) 35 | (setq compile-command 36 | (format 37 | "cd %s ; mvn test" 38 | (locate-dominating-file (buffer-file-name) "pom.xml")))) 39 | 40 | ;;;###autoload 41 | (defun mvn-init () 42 | "Initialize this package." 43 | (interactive) 44 | (add-hook 'java-mode-hook 'mvn-buffer-init)) 45 | 46 | (provide 'mvn-help) 47 | 48 | ;;; mvn-help.el ends here 49 | --------------------------------------------------------------------------------