lifeisfoo / emacs-grails

A minor mode for Grails projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Malformed function

fxleblanc opened this issue · comments

I am trying to activate the grails mode using the snippet provided by the README:

((nil . ((grails . 1))))

Elisp complains about malformed function.

Hi Félix,
I'm assuming that you're using the latest version of the grails mode (0.2.0) that has been uploaded yesterday. If not, consider to update it before proceed.

This snippet of code must be placed inside a .dir-locals.el file.
Here you can find an example file: it must be renamed to .dir-locals.el, edited according to your settings (uncommenting the last line in your case), and placed in the root of your grails project. In this way, the minor mode is always active in in the project directory tree.

To enable/disable the grails minore mode manually you could use M-x grails from emacs: the label Grails should appear in your emacs mode line (status bar at the bottom).

If the problem isn't fixed, please post here more information about your setup: emacs version, mode version, .emacs conf file...

I hope this help.

Hi, thanks for your answer. I placed your snippet in the .dir-locals.el and this time, the snippet

((groovy-mode (grails . 1))
 (html-mode (grails . 1))
 (java-mode (grails . 1)))

is flagged as a malformed function. Also, I don't know if this is related but when I put my cursor on html-mode, it gives me the following error in my messages:

Wrong type argument, sequencep, 1

Emacs version: GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) of 2015-09-09 on foutrelis
Grails-mode version: 0.2.0
Grails Version: 3.1.2
Groovy Version: 2.4.6
JVM Version: 1.8.0_74

Could you comment all your .dir-locals.el file (or just delete it) and try to manually enable grails mode (M-x grails) in a project file buffer (e.g. a domain class)?

Then check your *Messages* buffer for the Grails mode enabled message or an error.

If you can enable grails mode manually the problem should be your dir-locals.el file or in another emacs configurations. If the problem isn't solved, please paste here your ~/.emacs configuration file.

I deleted the .dir-locals.el file in my project directory and enabled grails manually. It works this way.

Like you said, it has probably something to do with my .dir-locals.el.

Here is my configuration https://github.com/fxleblanc-linux/.emacs.d.

Hi Félix,
I've looked at your emacs configuration (by the way, it's nice), but I can't figure out where the problem is. I'm pretty sure that the code in the .dir-locals.el file is ok, since it seems to respect the specification.

All I can tell you is to:

  • try with a clean .dir-locals.el and the "nil" code
  • try starting emacs with a clean init file (see this, or this on how to use a custom init file)
  • ask for help on stackoverflow or on an emacs mailing list

Keep me update and eventually write here the solution when you will find it. I'm really unhappy that this mode isn't working for you.

Hey Félix,
I've just cloned your repository in the temp directory and started emacs with:

env HOME=/tmp emacs

I've figured out that you are seeing the "Wrong type argument: sequencep, 1" error because of the active flycheck mode (this is the emacs modes line while editing .dir-locals.el with your init.el):

(Emacs-Lisp Undo-Tree WS AC FlyC:1/0)

I've double checked this, disabling the flycheck mode and no warning or error is shown. So you can use the .dir-locals.el (and the grails mode) even if you see this error: all works fine.

Probably this error is shown since the dir-locals file has a special syntax.

@lifeisfoo you're right, it works :). I wonder if there is a way to deactivate flycheck only for this file. Thanks for you help.