Git Product home page Git Product logo

groovy-emacs-modes's Introduction

Emacs Modes for Groovy and Grails

Coverage Status Licence MELPA MELPA

This repository contains Emacs modes for Groovy and Grails. The major features are syntax highlighting with groovy-mode, REPL integration with run-groovy and Grails project navigation with grails-mode.

Installation

Emacs 24+ is required.

These packages are available on MELPA. To use rolling releases:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

Alternatively, if you just want stable releases:

(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)

You can now use M-x list-packages to find groovy-mode and install it.

A Bit of History

This mode was originally developed as a derived mode of java-mode (a derived mode of cc-mode) inspired by Dylan R.E. Moonfire's C# mode. There are however what seem to be insurmountable obstacles to making groovy-mode based on CC Mode work as people want. Wilfred Hughes created a new groovy-mode (standalone) independent of CC Mode.

The CC Mode version of groovy-mode used to be master, and is the basis for the 1.0.1 version on MELPA. The work on standlone groovy-mode happened on a feature branch. As of 2017-05-08T08:00+01:00, the CC Mode version has been switched to the 1.X branch and the standalone version is now master and will be released as 2.0.0 as soon as viable.

cc-mode derived mode

The CC Mode version of groovy-mode is configured by overriding cc-mode settings, such as c-basic-offset.

Standalone mode (the default)

The new, and now default, standalone mode provides more robust highlighting and indentation, plus niceties like string interpolation highlighting, compared to the CC Mode based version..

screenshot

You can configure the standalone groovy-mode with M-x customize, and searching for groovy.

groovy-emacs-modes's People

Contributors

abkullberg avatar aij avatar akatov avatar ax006ho avatar buzztaiki avatar djlindstr avatar formerphysicist avatar kurnevsky avatar marcpa00 avatar prenaux avatar purcell avatar russel avatar ryuslash avatar snogge avatar syl20bnr avatar ujpandey avatar vincekd avatar wilfred avatar xqliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

groovy-emacs-modes's Issues

Update groovy-electric for latest groovy-mode

My version: This is GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
of 2016-04-17 on lgw01-04, modified by Debian

Leaving directory `/home/sam/.emacs.d/elpa/s-20170428.1026'

Compiling file /home/sam/.emacs.d/elpa/s-20170428.1026/s-pkg.el at Mon Jul 24 07:02:57 2017
Entering directory `/home/sam/.emacs.d/elpa/s-20170428.1026/'

Compiling file /home/sam/.emacs.d/elpa/s-20170428.1026/s.el at Mon Jul 24 07:02:57 2017

Compiling no file at Mon Jul 24 07:03:00 2017
Leaving directory `/home/sam/.emacs.d/elpa/gradle-mode-20150313.1205'

Compiling file /home/sam/.emacs.d/elpa/gradle-mode-20150313.1205/gradle-mode-pkg.el at Mon Jul 24 07:03:00 2017
Entering directory `/home/sam/.emacs.d/elpa/gradle-mode-20150313.1205/'

Compiling file /home/sam/.emacs.d/elpa/gradle-mode-20150313.1205/gradle-mode.el at Mon Jul 24 07:03:00 2017

Compiling no file at Mon Jul 24 07:05:32 2017
Leaving directory `/home/sam/.emacs.d/elpa/groovy-mode-201203310931'

Compiling file /home/sam/.emacs.d/elpa/groovy-mode-201203310931/groovy-mode-pkg.el at Mon Jul 24 07:05:32 2017
Entering directory `/home/sam/.emacs.d/elpa/groovy-mode-201203310931/'

Compiling file /home/sam/.emacs.d/elpa/groovy-mode-201203310931/groovy-mode.el at Mon Jul 24 07:05:32 2017

In groovy-lineup-arglist:
groovy-mode.el:437:38:Warning: reference to free variable
    `c-syntactic-element'

In groovy-mode:
groovy-mode.el:566:25:Warning: (lambda nil ...) quoted with ' rather than with
    #'
groovy-mode.el:566:25:Warning: (lambda nil ...) quoted with ' rather than with
    #'

In end of data:
groovy-mode.el:592:1:Warning: the function `c-populate-syntax-table' might not
    be defined at runtime.

Closure indentation on 20170808.1211

This is how 20170808.1211 currently indents closures:

class A {
    def foo() {
        [1, 2, 3]
            .findAll {
            it % 2 == 0
        }
            .collect { it ->
            it + 1
        }
    }
}

And I would say this is how it should be:

class A {
    def foo() {
        [1, 2, 3]
            .findAll {
                it % 2 == 0
            }
            .collect { it ->
                it + 1
            }
    }
}

Errors with annotations highlighting

I get this error Error during redisplay: (jit-lock-function 1001) signaled (void-variable c-annotation-face) when I have annotations on the page, which screws up keyword highlighting for the rest of the file.

Looking at java-mode it seems they just set annotations to the font-lock-function-name-face.

groovy-mode-hook removal of explicit definition

I added a definition of groovy-mode-hook as I thought it was missing compared to the previous mode. @Wilfred says it is not needed as it is implicitly defined. I'm just feeling defensive on this (lack of knowledge on my part most likely) so haven't actioned it. Can we check whether it can be removed?

Groovy-emacs-mode interferes with hi lock mode highlighting

using groovy-emacs-mode appears to interfere in some way with hi-lock mode highlighting. For instance, with groovy mode enabled, as well as 'M-x global-hi-lock-mode' set to 1, i cannot get highliting to work with 'C-x w .' on a higlighted selection. The message log reports "Error during redisplay: (jit-lock-function 2692) signaled (wrong-type-argument stringp nil)"

emacs version 24.4.1, groovy-emacs-mode 201311291207 from elpa

Indentation issues on 20170529.46

Hi,

I just installed 20170529.46 and quickly noticed three fundamental indentation issues:

class foo {
    def bar() {
        def a = 1
        def b = a +
        1
        def c =
        1
        def d = a
        .baz()
    }
}

Using Emacs 24.5.1.

File mode specification error: (void-function groovy-mode)

I just upgraded to groovy-mode 20170503.148 on my GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911)). Now I am getting the error in the subject line. Using MELPA to install my packages.

request: improve detection of multi-line statements

For code like this:

class Foo {
   public void bar() {
      int blah;
      int bar = blah
         .method1()
         .method2()
   }
}

when the cursor is on the lines with .method1() and .method2(), C-c C-o reveals that the current syntactic context is statement. I'd love for groovy mode to recognize these as statement-cont so they're indented properly. I can't tell if the issue is with c-guess-basic-syntax or groovy-vsemi-p.

I'd love a hand confirming my understanding of the issue, and even better, a fix.

Thanks much.

-DB

Add "groovy-send-string"

It would be nice for https://github.com/m0smith/malabar-mode to have a groovy-send string function like this. I can submit a pull request is you are interested.


(defun groovy-send-string (str)
  "Send a string to the inferior Groovy process."
  (interactive "r")

  (save-excursion
    (save-restriction
      (let ((proc (groovy-proc)))

      (with-current-buffer (process-buffer proc)
    (while (and
        (goto-char comint-last-input-end)
        (not (re-search-forward comint-prompt-regexp nil t))
        (accept-process-output proc)))
    (goto-char (process-mark proc))
    (insert-before-markers str)
    (move-marker comint-last-input-end (point))
    (comint-send-string proc str)
    (comint-send-string proc "\n")
    )
      )
    )))

Incorrect highlighting if literal string include comment like strings

If there are literal string in the Groovy script that look like comments then the syntax highlighting goes wrong.

e.g

"https://myartifactoryserver.company.net/api/copy/"
or "pattern": "${src}/*",

In the first example the syntax highlighting switches to comment at the // and runs until some higher level terminator triggers and in the second it switches to comment mode at the /* and run until it sees a */ i.e. the end of a later comment.

This not only makes things hard to read but also upsets the indentation system as well.

wrong command in groovy-load-file

AFAIK there are two issues in inf-groovy.el.

  1. line 140 is doubled
  2. commands in the groovysh are abbreviated with a starting colon, not a backslash
    I attach a patch which solves these issues. On Linux it can be applied by

patch inf-groovy.el -i 00diff.txt
00diff.txt
-o inf-groovy.el.new

followed by

mv inf-groovy.el.new inf-groovy.el

I would appreciate this patch being applied in the repository and not on my local machine.

Thanks in advance and thank you for providing groovy-emacs-mode!

Jobst Hoffmann

Require groovy-mode with value added to hook results in error: Symbol's value as variable is void: inf-groovy-keys

It looks like when the hook is evaluated, it is calling the first element in the hook with the second. Very weird.

Groovy mode: .emacs.d/elpa/groovy-mode-20141209.1133/

groovy-mode-hook is a variable defined in `groovy-mode.el'.
Its value is (malabar-groovy-mode inf-groovy-keys)
Original value was nil

The backtrace


  (malabar-groovy-mode inf-groovy-keys)
  (lambda nil (malabar-groovy-mode inf-groovy-keys))()
  funcall((lambda nil (malabar-groovy-mode inf-groovy-keys)))
  (if (not (equal file (quote "c:/Users/lpmsmith/.emacs.d/elpa/groovy-mode-20141209.1133/groovy-mode.el"))) nil (remove-hook (quote after-load-functions) (quote eval-after-load-helper)) (funcall (quote (lambda nil (malabar-groovy-mode inf-groovy-keys)))))
  eval-after-load-helper("c:/Users/lpmsmith/.emacs.d/elpa/groovy-mode-20141209.1133/groovy-mode.el")
  run-hook-with-args(eval-after-load-helper "c:/Users/lpmsmith/.emacs.d/elpa/groovy-mode-20141209.1133/groovy-mode.el")
  do-after-load-evaluation("c:/Users/lpmsmith/.emacs.d/elpa/groovy-mode-20141209.1133/groovy-mode.el")
  load-with-code-conversion("c:/Users/lpmsmith/.emacs.d/elpa/groovy-mode-20141209.1133/groovy-mode.el" "c:/Users/lpmsmith/.emacs.d/elpa/groovy-mode-20141209.1133/groovy-mode.el" nil t)
  require(groovy-mode)
  eval((require (quote groovy-mode)) nil)
  eval-expression((require (quote groovy-mode)) nil)
  call-interactively(eval-expression nil nil)

Tests failing

Even though all the tests pass of Travis-CI, when I run the command to run the tests on Fedora Rawhide, I get:

|> cask exec ert-runner 
......Test test-for-issue-56 backtrace:

  (if (unwind-protect (setq value-62 (apply fn-60 args-61)) (setq form
  (let (form-description-64) (if (unwind-protect (setq value-62 (apply
  (let ((value-62 (quote ert-form-evaluation-aborted-63))) (let (form-
  (let ((fn-60 (function equal)) (args-61 (list (buffer-string) "class
  (let ((text "class foo {\ndef bar() {\ndef a = 1\ndef b = a +\n1\nde
  (progn (let ((text "class foo {\ndef bar() {\ndef a = 1\ndef b = a +
  (unwind-protect (progn (let ((text "class foo {\ndef bar() {\ndef a 
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-b
  (lambda nil (let ((temp-buffer (generate-new-buffer " *temp*"))) (sa
  ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
  ert-run-test([cl-struct-ert-test test-for-issue-56 nil (lambda nil (
  ert-run-or-rerun-test([cl-struct-ert--stats (and t) [[cl-struct-ert-
  ert-run-tests((and t) (lambda (event-type &rest event-args) (cond ((
  ert-runner/run-tests-batch((and t))
  (let ((stats (ert-runner/run-tests-batch selector))) (kill-emacs (if
  ert-runner/run-tests-batch-and-exit((and t))
  (if ert-runner-verbose (ert-runner/run-tests-batch-and-exit ert-runn
  (let ((test-files (ert-runner--test-files tests)) (test-helper (f-ex
  ert-runner/run()
  apply(ert-runner/run nil)
  commander--handle-command(nil)
  commander-parse(nil)
  (if commander-parsing-done nil (commander-parse (or commander-args (
  eval-buffer(#<buffer  *load*> nil "/home/users/russel/Repositories/G
  load-with-code-conversion("/home/users/russel/Repositories/Git/Forks
  load("/home/users/russel/Repositories/Git/Forks/Groovy-Emacs-Modes/.
  command-line-1(("-scriptload" "/home/users/russel/Repositories/Git/F
  command-line()
  normal-top-level()

Test test-for-issue-56 condition:

    (ert-test-failed
     ((should
       (equal
	(buffer-string)
	"class foo {
    def bar() {
        def a = 1
        def b = a +
            1
        def c =
            1
        def d = a
            .baz()
    }
}
"))
      :form
      (equal "class foo {
    def bar() {
	def a = 1
	def b = a +
	    1
	def c =
	    1
	def d = a
	    .baz()
    }
}
" "class foo {
    def bar() {
        def a = 1
        def b = a +
            1
        def c =
            1
        def d = a
            .baz()
    }
}
")
      :value nil :explanation
      (arrays-of-different-length 106 155 "class foo {
    def bar() {
	def a = 1
	def b = a +
	    1
	def c =
	    1
	def d = a
	    .baz()
    }
}
" "class foo {
    def bar() {
        def a = 1
        def b = a +
            1
        def c =
            1
        def d = a
            .baz()
    }
}
" first-mismatch-at 28)))

F..

Ran 9 tests in 0.027 seconds
1 unexpected results:
   FAILED  test-for-issue-56

Update the personnel and docs

@Wilfred Perhaps you should update the groovy-mode.el to put yourself in as author?

Also we should do a serious updated of the commentary etc. to reflect the revolutionary change of the mode.

Moreover I wonder if a couple of examples of configuration for the init.el files might be in order?

Melpa is installing the old package by default

I'm installing from melpa. Looks like that installs the old version by default?
From package-list-packages

groovy-mode        201203310931  installed             Groovy mode derived mode

The newer versions are marked as obsolete:

groovy-mode        20170323.817  obsolete              Major mode for Groovy source files
groovy-mode        20170503.148  obsolete              Major mode for Groovy source files
groovy-mode        20170516.1155 obsolete              Major mode for Groovy source files

Probably because the old version is missing a . between date and version.

Incorrect highlighting of keyword arguments without parentheses

If I call a function with keyword arguments, but without parentheses (common in Jenkinsfile scripts):

foo x: 1, y: 2

The x is incorrectly highlighted with font-lock-type-face.

groovy_highlight

It's not clear to me which part of the syntax is doing this -- any pointers?

'common' is incorrectly highlighted as keyword

Given the code:

def foo
def common
def bar

Groovy mode shows the following highlighting:

screen shot 2017-03-01 at 15 13 49

It's applied font-lock-type-face to common. I'm not sure why, I can't see common listed in any keyword list in the code for groovy. It's also not a reserved word for C or Java as far as I can tell.

Any idea why this happens?

Wrong indentation or wrong setup?

Hi,

I just installed this mode (version 20150725.1050) and I get the following indentation:

g.traversal().V()
.method()

Shouldn't the second line be intended a few spaces to the left? If so, is this bug in the mode or maybe I have a setup that is messing things up?

Thanks

Doesn't even load

The master branch (at commit f8e9628) fails to load

Debugger entered--Lisp error: (file-error "Cannot open load file" "s")
require(s)
eval-buffer(#<buffer load-736134> nil "XXXXXXXXX/groovy-emacs-modes/groovy-mode.el" nil t) ; Reading at buffer position 2657
load-with-code-conversion("XXXXXXXXX/groovy-emacs-modes/groovy-mode.el" "XXXXXX/groovy-emacs-modes/groovy-mode.el" nil nil)
load("groovy-mode")
load-library("groovy-mode")
(progn (load-library "groovy-mode") (setq auto-mode-alist (append (quote (("\.groovy\'" . groovy-mode) ("\JenkinsFile" . groovy-mode))))) (add-hook (quote groovy-mode-hook) (quote (lambda nil (require (quote groovy-electric)) (groovy-electric-mode)))))
(if (locate-library "groovy-mode") (progn (load-library "groovy-mode") (setq auto-mode-alist (append (quote (("\.groovy\'" . groovy-mode) ("\JenkinsFile" . groovy-mode))))) (add-hook (quote groovy-mode-hook) (quote (lambda nil (require (quote groovy-electric)) (groovy-electric-mode))))))
eval-buffer(#<buffer load> nil "/XXXXXX/.emacs" nil t) ; Reading at buffer position 5740
load-with-code-conversion("/XXXXX/.emacs" "/XXXXX/.emacs" t t)
load("/.emacs" t t)
#[0 "�\205\262 \306=\203�\307�\310Q\202; \311=\204�\307�\312Q\202;\313\307\314\315#\203*\316\202;\313\307\314\317#\203:\320\nB�\321\202;\316\322�\323�\322\211#\210�\322=\203a\324\325\326\307�\327Q!"\323�\322\211#\210�\322=\203��\210�\203\243\330�!\331\232\203\243\332�!\211\333P\334�!\203}\211\202\210\334�!\203\207�\202\210\314\262��\203\241\335��\"\203\237\336\337��#\210\340\341!\210��\266�\f?\205\260\314�\323\342\322\211#)\262�\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" (initialization "_emacs' init file is deprecated, please use `.emacs'") "
/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7 "\n\n(fn)"]()
command-line()
normal-top-level()

Indent argument keys properly

Groovy autoindent mostly works, but when I press TAB for argument keys, Groovy mistakenly indents them to the far left column, rather than one level deep where they should be.

Reassess Old Issues

@Wilfred We need to go through all the old issues to see if they apply to the new version of the mode or just the old version. If they only apply to the old version then perhaps we should archive them in some way, leaving just the issues that apply to the new version of the mode.

Variable types are not highlighted

Given the following code:

def foo() {
    String x = 'foo'
    String y = 'foo'
    Thing z = new Thing()
    LinkedList otherLinked = [3, 4, 5]
    int num = 123
    String[] arrStr = ['Ananas', 'Banana', 'Kiwi']
}

groovy_types

Most of the types are not highlighted. It looks like it's just the first type, plus any primitive types.

Failure to load in Emacs 25

I'm using Emacs 25.1.1. When I try to run groovy-mode, the mode fails to start, with the following error:

Eval error in the ‘c-lang-defconst’ for ‘c-constant-kwds’ in groovy-mode:
Eval error in the ‘c-lang-defconst’ for ‘c-basic-matchers-before’ in groovy-mode:
Eval error in the ‘c-lang-defconst’ for ‘c-matchers-2’ in groovy-mode:
c-get-lang-constant: Invalid function: (quote ("true" "false" "null"))

More indentation issues on 20170606.215

Hi, I have noticed the following indentation issues. For each issue I have specified how it works today, and how I would expect it to work based on my experience with modes of other languages.

1. Overly indented closure body

Current:

def foo() {
    def f = { ->
            "foo"
    }
}

Desired:

def foo() {
    def f = { ->
        "foo"
    }
}

2. Unaligned list items

Current:

def foo() {
    // works well
    def f = [
       1,
       2,
       3,
    ]
    // doesn't work well
    def f2 = [1,
        2,
        3,
    ]
}

Desired:

def foo() {
    def f = [
       1,
       2,
       3,
    ]
    def f2 = [1,
              2,
              3,
             ]
}

3. Unaligned map items

(same problem as for lists)
Current:

def foo() {
    // works well
    def f = [
        a: 1,
        b: 2,
        c: 3
    ]
    // doesn't work well
    def f2 = [a: 1,
        b: 2,
        c: 3
    ]
}

Desired:

def foo() {
    def f = [
        a: 1,
        b: 2,
        c: 3
    ]
    def f2 = [a: 1,
              b: 2,
              c: 3
             ]
}

4. Unaligned function arguments

(Same as for lists and maps)
Current:

def foo() {
    // works well
    someFunction(
        1,
        2,
        3)
    // doesn't work well
    someFunction(1,
        2,
        3)
}

Desired:

def foo() {
    someFunction(
        1,
        2,
        3)
    someFunction(1,
                 2,
                 3)
}

5. Wrongly indented arguments within method chaining

Current:

def foo() {
    someFunction()
        .anotherFunction1(
        param1,
        param2)
        .anotherFunction2()
}

Desired:

def foo() {
    // support both this:
    someFunction()
        .anotherFunction1(
            param1,
            param2)
        .anotherFunction2()
    // and this:
    someFunction()
        .anotherFunction1(param1,
                          param2)
        .anotherFunction2()
}

6. Closing curly bracket does not auto-indent

def foo() {
    if (1) {
        }
}

I have to manually press Tab on the line of the closing curly bracket for it to get indented properly. Both java and js modes indent closing curly brackets automatically.

Will keep reporting as I find more of these cases.

Thank you for your work! 🙏

Indent Spock blocks

I will freely admit I am new to both Groovy and Spock, and not enough of an Emacs hacker to take this on alone.

When I'm writing spock in groovy mode, the blocks (given, when, then, etc...) are not being indented in the same way that other statements would be.

Example:

class ResourceOwnerPasswordCredentialsSpec extends Specification {

  def "Ability to get access token with valid client and user credentials"() {

  given:
  def http = new HTTPBuilder('https://gdmlx0016.hq.bigcompany.com:8445')
  http.ignoreSSLIssues()

  def postBody = [grant_type: 'password', username: '[email protected]', password: 'password123']

  when:
  def resp = http.post( path : '/oauth/token', body: postBody, headers: [ Authorization: 'Basic OGFiNjJhOWMtMWI4Ni00ZDJhLTlkNGItMTUwODJiYzNmMDA0OjNpSnRQamVNdkk='] )

  then:
  resp.access_token.size() == 103

  } 
}

If I highlight all of that code and hit tab, the "given:" line does not tab in. I would expect that it would. If I put a regular statement above that line, it does get indented.

class ResourceOwnerPasswordCredentialsSpec extends Specification {
  def "Ability to get access token with valid client and user credentials"() {

    def indentationIsWorkingHere = true

  given:
  def http = new HTTPBuilder('https://gdmlx0016.hq.bigcompany.com:8445')
  http.ignoreSSLIssues()

  def postBody = [grant_type: 'password', username: '[email protected]', password: 'password123']

  when:
  def resp = http.post( path : '/oauth/token', body: postBody, headers: [ Authorization: 'Basic OGFiNjJhOWMtMWI4Ni00ZDJhLTlkNGItMTUwODJiYzNmMDA0OjNpSnRQamVNdkk='] )

  then:
  resp.access_token.size() == 103

  } 
}

Is this something I can fix in my .emacs file? Or is the mode not catching this type of line? When I look at other examples of spock tests I'm seeing these lines indented.

Make } trigger indentation

Feature request: the character } should be an "electric" character, i.e. a character which triggers indentation.

Comment handling is broken

The font-lock behaviour with comments is wrong. // without a following space is not treated as a comment. // with a following space is.

Can't load groovy-mode : File mode specification error: (void-function set-difference)

I installed groovy-mode via melpa (20141209) today.
I opened a simple groovy file:

class Main {
    static void main(String... args) {
        println 'Hello'
    }
}

groovy-mode should have fired up but failed:
File mode specification error: (void-function set-difference)

During the installation with melpa, there was that error:

Compiling file /home/paraita/.emacs.d/elpa/groovy-mode-20141209.1133/groovy-electric.el at Sun May 10 00:37:58 2015
Entering directory `/home/paraita/.emacs.d/elpa/groovy-mode-20141209.1133/'
groovy-electric.el:55:1:Error: Symbol's function definition is void: set-difference

Compiling file /home/paraita/.emacs.d/elpa/groovy-mode-20141209.1133/groovy-mode.el at Sun May 10 00:37:58 2015
groovy-mode.el:354:1:Error: Symbol's function definition is void: set-difference

Compiling file /home/paraita/.emacs.d/elpa/groovy-mode-20141209.1133/inf-groovy.el at Sun May 10 00:37:58 2015
inf-groovy.el:51:1:Error: Symbol's function definition is void: set-difference

but it installed anyway.

Forcing the (require 'cl) in groovy-mode.el solved my problem.

I am using Emacs 24.5.1 on Archlinux x86_64
and yeah I'm aware of the cc-mode bug.

case keywords inside switch is not indenting correctly

The case and default keywords are not indented correctly (they are moved to the same column as the containing switch keyword). Also, the block inside a case is started at that column, and not in a further indentation as I would expect. (But perhaps my expectations are wrong?)

I'm using groovy-mode-20170323.817

cl-macroexpand-all is void

It looks like cl-macroexpand-all has been renamed macroexpand-all in emacs 24.3.

This causes groovy-mode to fail to load.

MELPA doesn't list groovy-mode

The readme describes how to use MELPA to load the groovy-mode, but groovy-mode does not appear in the list of packages.

treat groovy-mode as a prog-mode

Please configure groovy-mode so that it is considered a prog-mode, like c-mode, javascript-mode, ruby-mode, etc., so that tools like whitespace-mode can autoload for Groovy code.

How do we implement groovy-mode from MELPA for .gradle files?

Terribly newby question here, but I haven't used MELPA in the past, and I had no luck trying to load your groovy-mode.el file the normal way that I've done others under emacs.d/lisp/groovy-mode.

I've got this at the bottom of my .emacs:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

What perchance do I do in addition to get my .gradle files to syntax highlight in groovy-mode? Thanks!

[OSX 10.11.2] byte-compile failling on 24.5

I'm getting the following error(s) when trying to compile groovy-mode.el:

Eval error in the `c-lang-defconst' for `c-regular-keywords-regexp' in groovy-mode:
Eval error in the `c-lang-defconst' for `c-basic-matchers-before' in groovy-mode:
Eval error in the `c-lang-defconst' for `c-matchers-2' in groovy-mode:

In toplevel form:
groovy-mode.el:354:1:Error: Symbol's function definition is void: set-difference

To me it looks like http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18845 wasn't actually fixed in 24.5, since it does build when the (require 'cl) is applied to 24.5 in addition to 24.4 and below (https://github.com/Groovy-Emacs-Modes/groovy-emacs-modes/blob/master/groovy-mode.el#L93).

It builds fine with the current emacs-25 branch though, so no worries there.

Switch branches now?

I wonder if we are now at the stage where we take a maintenance branch of the CC mode version (version 1) and make standalone branch the master and declare it version 2. This leaves both version available but makes it clear the standalone version is the mainline.

For standalone mode need specialisation document

With the CC Mode version of this mode documenting the ways of changing things like indent size etc. was (relatively) easy because it was a variant on java-mode, c++-mode, and c-mode. Now it is not clear how to set these things. a short document setting out the user (re)settable values would be very handy.

"No such file ..." error on run-groovy command

Hi @russel

I wish to use the groovy-mode and I've installed it from MELPA via package manager. Syntax-highlight etc are working fine but when I do run-groovy command the inferior groovy buffer opens up and throws the error
No such file or directory

I've have checked that the groovysh etc commands are working fine. I used brew install groovy for the installation. Is this a path config error, how to correct it?

Groovy Mode not available

I am unable to install groovy mode through elpa (Not Found):

Saving file /home/mansour/.emacs.d/elpa/groovy-mode-readme.txt...
Wrote /home/mansour/.emacs.d/elpa/groovy-mode-readme.txt
Type C-x 1 to delete the help window.
Install package `groovy-mode'? y
Contacting host: stable.melpa.org:80
package-handle-response: Error during download request: Not Found
user-error: Minibuffer window is not active

This is from my .emacs

(require 'package) ;; You might already have this line
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(add-to-list 'package-archives '("melpa-2" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/") t)
(package-initialize)
(require 'gradle-mode)
(gradle-mode 1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.