Codebase list develock-el / c278955
Add groovy mode Mehdi Dogguy 5 years ago
2 changed file(s) with 118 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 From: Benedikt Spranger <b.spranger@linutronix.de>
1 Date: Thu, 26 Jul 2018 17:42:35 +0200
2 Subject: Add-groovy-mode
3
4 ---
5 develock.el | 31 +++++++++++++++++++------------
6 1 file changed, 19 insertions(+), 12 deletions(-)
7
8 diff --git a/develock.el b/develock.el
9 index 195452a..7fe69af 100644
10 --- a/develock.el
11 +++ b/develock.el
12 @@ -10,7 +10,7 @@
13 ;; Created: 2001/06/28
14 ;; Revised: 2015/10/14
15 ;; Keywords: font-lock emacs-lisp change-log texinfo c java perl html
16 -;; tcl ruby mail news
17 +;; tcl ruby mail news groovy
18
19 ;; Develock is free software; you can redistribute it and/or modify
20 ;; it under the terms of the GNU General Public License as published by
21 @@ -33,9 +33,9 @@
22 ;; lock highlight leading and trailing whitespace, long lines and
23 ;; oddities in the file buffer for Lisp modes, ChangeLog mode, Texinfo
24 ;; mode, C modes, Ocaml modes, Coq mode, Java mode, Jde-mode , CPerl
25 -;; mode, Perl mode, HTML modes, some Mail modes, Tcl mode and Ruby
26 -;; mode. Here is an example of how to set up your startup file
27 -;; (possibly .emacs) to use Develock:
28 +;; mode, Perl mode, HTML modes, some Mail modes, Tcl mode, Ruby mode
29 +;; and Groovy mode. Here is an example of how to set up your startup
30 +;; file (possibly .emacs) to use Develock:
31 ;;
32 ;;(cond ((featurep 'xemacs)
33 ;; (require 'develock)
34 @@ -67,6 +67,7 @@
35 ;; (add-hook 'perl-mode-hook 'turn-on-font-lock)
36 ;; (add-hook 'mail-setup-hook 'turn-on-font-lock)
37 ;; (add-hook 'java-mode-hook 'turn-on-font-lock)
38 +;; (add-hook 'groovy-mode-hook 'turn-on-font-lock)
39 ;; (add-hook 'html-mode-hook 'turn-on-font-lock)
40 ;; (add-hook 'html-helper-mode-hook 'turn-on-font-lock)
41 ;; (add-hook 'message-mode-hook 'turn-on-font-lock)
42 @@ -422,6 +423,7 @@ That would be defenseless to spammers."
43 'message-mode t
44 'cmail-mail-mode t
45 'tcl-mode 79
46 + 'groovy-mode 79
47 'ruby-mode 79)
48 "Plist of `major-mode's and limitation values for long lines.
49 The part of a line that is longer than the limitation value according
50 @@ -460,7 +462,7 @@ the value will be modified."
51
52 (defcustom develock-mode-ignore-kinsoku-list
53 '(emacs-lisp-mode lisp-interaction-mode c-mode c++-mode java-mode jde-mode
54 - cperl-mode perl-mode tcl-mode)
55 + cperl-mode perl-mode tcl-mode groovy-mode)
56 "List of `major-mode's that ignore kinsoku at the end of lines."
57 :type '(repeat (symbol :format "Major-Mode: %v\n" :size 0))
58 :set 'develock-custom-set-and-refontify
59 @@ -638,7 +640,9 @@ try the following advice in your startup file.
60 (tcl-mode tcl-font-lock-keywords-x
61 develock-tcl-font-lock-keywords)
62 (ruby-mode ruby-font-lock-keywords-x
63 - develock-ruby-font-lock-keywords))
64 + develock-ruby-font-lock-keywords)
65 + (groovy-mode java-font-lock-keywords-x
66 + develock-java-font-lock-keywords))
67 "*Alist of keyword symbols for major modes.
68 Each element should be triple symbols of the following form:
69
70 @@ -2042,14 +2046,15 @@ IGNORE-POINT-POS are ignored."
71 (start end &optional column) activate)
72 "Advised by Develock.
73 If Develock is on, remove useless leading and trailing whitespace in
74 -Lisp modes, C modes and Java mode. You can turn off this advice
75 +Lisp modes, C modes, Java mode and Groovy mode. You can turn off this advice
76 permanently by customizing the `develock-energize-functions-plist'
77 variable."
78 (if (and develock-mode font-lock-mode
79 (plist-get develock-energize-functions-plist 'indent-region)
80 (memq major-mode '(emacs-lisp-mode
81 lisp-interaction-mode
82 - c-mode c++-mode java-mode jde-mode)))
83 + c-mode c++-mode
84 + java-mode jde-mode groovy-mode)))
85 (save-excursion
86 ;; Meddle with out of the region.
87 (goto-char end)
88 @@ -2063,7 +2068,8 @@ variable."
89 (c-mode . develock-c-indent-line)
90 (c++-mode . develock-c-indent-line)
91 (java-mode . develock-c-indent-line)
92 - (jde-mode . develock-c-indent-line))))))
93 + (jde-mode . develock-c-indent-line)
94 + (groovy-mode . develock-c-indent-line))))))
95 (goto-char start)
96 (while (and (zerop (forward-line -1))
97 (or (looking-at "[\t ]+$")
98 @@ -2111,14 +2117,15 @@ You can turn off this advice permanently by customizing the
99 (defadvice newline-and-indent (around remove-useless-whitespace activate)
100 "Advised by Develock.
101 If Develock is on, remove useless leading and trailing whitespace and
102 -indent appropriately in Lisp modes, C modes and Java mode. You can
103 -turn off this advice permanently by customizing the
104 +indent appropriately in Lisp modes, C modes, Java mode and Groovy mode.
105 +You can turn off this advice permanently by customizing the
106 `develock-energize-functions-plist' variable."
107 (if (and develock-mode font-lock-mode
108 (plist-get develock-energize-functions-plist 'newline-and-indent))
109 (cond ((memq major-mode '(emacs-lisp-mode lisp-interaction-mode))
110 (develock-lisp-indent-line))
111 - ((memq major-mode '(c-mode c++-mode java-mode jde-mode))
112 + ((memq major-mode '(c-mode c++-mode
113 + java-mode jde-mode groovy-mode))
114 (develock-c-indent-line))))
115 ad-do-it))
116
00 0001-More-modes.patch
11 0002-advising-indent-region-with-correct-prototype.patch
2 0003-Add-groovy-mode.patch