1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
From: Benedikt Spranger <b.spranger@linutronix.de>
Date: Thu, 26 Jul 2018 17:42:35 +0200
Subject: Add-groovy-mode
---
develock.el | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/develock.el b/develock.el
index 195452a..7fe69af 100644
--- 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,6 +423,7 @@ That would be defenseless to spammers."
'message-mode t
'cmail-mail-mode t
'tcl-mode 79
+ 'groovy-mode 79
'ruby-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
@@ -460,7 +462,7 @@ the value will be modified."
(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 @@ try the following advice in your startup file.
(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 @@ IGNORE-POINT-POS are ignored."
(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 @@ variable."
(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 @@ You can turn off this advice permanently by customizing the
(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))
|