--- a/develock.el +++ b/develock.el @@ -10,7 +10,7 @@ ;; Created: 2001/06/28 ;; Revised: 2015/10/14 ;; Keywords: font-lock emacs-lisp change-log texinfo c java perl html -;; tcl ruby mail news +;; tcl ruby mail news groovy ;; Develock is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -33,9 +33,9 @@ ;; lock highlight leading and trailing whitespace, long lines and ;; oddities in the file buffer for Lisp modes, ChangeLog mode, Texinfo ;; mode, C modes, Ocaml modes, Coq mode, Java mode, Jde-mode , CPerl -;; mode, Perl mode, HTML modes, some Mail modes, Tcl mode and Ruby -;; mode. Here is an example of how to set up your startup file -;; (possibly .emacs) to use Develock: +;; mode, Perl mode, HTML modes, some Mail modes, Tcl mode, Ruby mode +;; and Groovy mode. Here is an example of how to set up your startup +;; file (possibly .emacs) to use Develock: ;; ;;(cond ((featurep 'xemacs) ;; (require 'develock) @@ -67,6 +67,7 @@ ;; (add-hook 'perl-mode-hook 'turn-on-font-lock) ;; (add-hook 'mail-setup-hook 'turn-on-font-lock) ;; (add-hook 'java-mode-hook 'turn-on-font-lock) +;; (add-hook 'groovy-mode-hook 'turn-on-font-lock) ;; (add-hook 'html-mode-hook 'turn-on-font-lock) ;; (add-hook 'html-helper-mode-hook 'turn-on-font-lock) ;; (add-hook 'message-mode-hook 'turn-on-font-lock) @@ -422,7 +423,8 @@ 'message-mode t 'cmail-mail-mode t 'tcl-mode 79 - 'ruby-mode 79) + 'ruby-mode 79 + 'groovy-mode 79) "Plist of `major-mode's and limitation values for long lines. The part of a line that is longer than the limitation value according to the `major-mode' is highlighted. Value `w' means one subtracted @@ -460,7 +462,7 @@ (defcustom develock-mode-ignore-kinsoku-list '(emacs-lisp-mode lisp-interaction-mode c-mode c++-mode java-mode jde-mode - cperl-mode perl-mode tcl-mode) + cperl-mode perl-mode tcl-mode groovy-mode) "List of `major-mode's that ignore kinsoku at the end of lines." :type '(repeat (symbol :format "Major-Mode: %v\n" :size 0)) :set 'develock-custom-set-and-refontify @@ -638,7 +640,9 @@ (tcl-mode tcl-font-lock-keywords-x develock-tcl-font-lock-keywords) (ruby-mode ruby-font-lock-keywords-x - develock-ruby-font-lock-keywords)) + develock-ruby-font-lock-keywords) + (groovy-mode java-font-lock-keywords-x + develock-java-font-lock-keywords)) "*Alist of keyword symbols for major modes. Each element should be triple symbols of the following form: @@ -2042,14 +2046,15 @@ (start end &optional column) activate) "Advised by Develock. If Develock is on, remove useless leading and trailing whitespace in -Lisp modes, C modes and Java mode. You can turn off this advice +Lisp modes, C modes, Java mode and Groovy mode. You can turn off this advice permanently by customizing the `develock-energize-functions-plist' variable." (if (and develock-mode font-lock-mode (plist-get develock-energize-functions-plist 'indent-region) (memq major-mode '(emacs-lisp-mode lisp-interaction-mode - c-mode c++-mode java-mode jde-mode))) + c-mode c++-mode + java-mode jde-mode groovy-mode))) (save-excursion ;; Meddle with out of the region. (goto-char end) @@ -2063,7 +2068,8 @@ (c-mode . develock-c-indent-line) (c++-mode . develock-c-indent-line) (java-mode . develock-c-indent-line) - (jde-mode . develock-c-indent-line)))))) + (jde-mode . develock-c-indent-line) + (groovy-mode . develock-c-indent-line)))))) (goto-char start) (while (and (zerop (forward-line -1)) (or (looking-at "[\t ]+$") @@ -2111,14 +2117,15 @@ (defadvice newline-and-indent (around remove-useless-whitespace activate) "Advised by Develock. If Develock is on, remove useless leading and trailing whitespace and -indent appropriately in Lisp modes, C modes and Java mode. You can -turn off this advice permanently by customizing the +indent appropriately in Lisp modes, C modes, Java mode and Groovy mode. +You can turn off this advice permanently by customizing the `develock-energize-functions-plist' variable." (if (and develock-mode font-lock-mode (plist-get develock-energize-functions-plist 'newline-and-indent)) (cond ((memq major-mode '(emacs-lisp-mode lisp-interaction-mode)) (develock-lisp-indent-line)) - ((memq major-mode '(c-mode c++-mode java-mode jde-mode)) + ((memq major-mode '(c-mode c++-mode + java-mode jde-mode groovy-mode)) (develock-c-indent-line)))) ad-do-it))