conf-gradle.el 608 B

1234567891011121314151617181920212223242526
  1. ;;; Code:
  2. (require 'gradle-mode)
  3. ;; Control
  4. (defconst distopico:gradle-file-regexp
  5. (concat "\\`" (regexp-quote "*.gradle") "\\'"))
  6. (add-to-list 'auto-mode-alist '("\\.gradle\\'" . groovy-mode))
  7. ;; Functions
  8. (defun distopico:gradle-hook ()
  9. "Hooks for gradle in modes like `nxml-mode',`java-mode',`kotlin-mode'."
  10. ;; Active gradle-mode if match manifest
  11. (cond
  12. ((distopico:locate-parent-file distopico:gradle-file-regexp)
  13. (gradle-mode t))))
  14. ;; Hooks
  15. (mapc
  16. (lambda (mode)
  17. (add-hook mode #'distopico:gradle-hook))
  18. '(java-mode-hook kotlin-mode-hook nxml-mode-hook))
  19. (provide 'conf-gradle)