Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Groovy
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<h1>Preamble</h1><h3><em>This page is an old one kept around only for the historical record. The materials mentioned as being in the Groovy Subversion repository have been deleted from that repository, so the links for those files are broken.</em></h3><h3>Russel Winder's mode and Stuart Clayman's inferior mode have been collected together in a Git repository, heavily worked on by Jim Morris, which is available for use by <a href="https://launchpad.net/groovy-emacs-mode">download from the Launchpad page</a>. See also the current and up-to-date page <a class="confluence-link" href="/display/GROOVY/Emacs+Groovy+Mode" data-linked-resource-id="136118390" data-linked-resource-type="page" data-linked-resource-default-alias="Emacs Groovy Mode" data-base-url="http://docs.codehaus.org">Emacs Groovy Mode</a>.</h3><h1>groovy-mode for (X)Emacs</h1><p>Jeremy Rayner created a groovy-mode for (X)Emacs, which has syntax hilighting, recognises curly brace indentation (just use the tab key), and doesn't panic about optional semicolons. He tested it in Emacs on Mac OSX 10.3, and others use it and it isn't painful.</p><p>Russel Winder has begun an alternative version of groovy-mode as a derived mode in CC Mode. Currently, this has some problems with indenting when semicolons are not used as statement terminators but this is being actively worked on -- CC Mode has support for languages like Awk and Groovy that do not require semicolons.</p><p>Stuart Clayman has created a "Groovy inferior mode" (nothing inferior about Stuart's code but this is the jargon for an interpreter execution mode) which allows groovysh to be run from within (X)Emacs. </p><h3>Download</h3><p>(NB Links go to the latest versions in Subversion)</p><p>Download Jeremy's <a href="http://svn.groovy.codehaus.org/browse/~raw,r=HEAD/groovy/trunk/groovy/ide/groovy-emacs/groovy-mode.el">groovy-mode.el</a> file and place it somewhere like (on OSX)<br /> <code>/usr/share/emacs/site-lisp/groovy-mode.el</code><br /> your mileage may vary...</p><p>Download Russel's <a href="http://svn.groovy.codehaus.org/browse/~raw,r=HEAD/groovy/trunk/groovy/ide/emacs/groovy-mode.el">groovy-mode.el</a> and place it in your (X)Emacs' load path.</p><p>NB As both Jeremy's and Russel's are called groovy-mode you have to have one or the other, you can't have both.</p><p>Download Stuart's <a href="http://svn.groovy.codehaus.org/browse/~raw,r=HEAD/groovy/trunk/groovy/ide/emacs/inf-groovy.el">inf-groovy.el</a> and place it in your (X)Emacs load path.</p><p>I had problems with Fisheye, and had to go to SVN directly. Here are the links:<br /> Jeremy's <a href="http://svn.codehaus.org/groovy/trunk/groovy/ide/groovy-emacs/groovy-mode.el">groovy-mode.el</a>.<br /> Russel's <a href="http://svn.codehaus.org/groovy/trunk/groovy/ide/emacs/groovy-mode.el">groovy-mode.el</a>.<br /> Stuart's <a href="http://svn.codehaus.org/groovy/trunk/groovy/ide/emacs/inf-groovy.el">inf-groovy.el</a>.</p><h3>.emacs</h3><p>add the following lines to your ~/.emacs file:</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>;;; turn on syntax hilighting (global-font-lock-mode 1) ;;; use groovy-mode when file ends in .groovy or has #!/bin/groovy at start (autoload 'groovy-mode "groovy-mode" "Groovy editing mode." t) (add-to-list 'auto-mode-alist '("\.groovy$" . groovy-mode)) (add-to-list 'interpreter-mode-alist '("groovy" . groovy-mode)) </pre></td></tr></table><h3>TODO</h3><p>Comments regarding Jeremy's mode:</p><ul><li>check this works in xemacs, and put your results in this page (anyone can edit <img class="emoticon emoticon-smile" data-emoticon-name="smile" border="0" src="/s/en_GB/3278/15/_/images/icons/emoticons/smile.png" alt="(smile)" title="(smile)" />)<ul><li>The Groovy mode appears to work in XEmacs, but setting the global-font-lock-mode gets a message and was commented. Thanks!</li><li>I concur that groovy mode works in XEmacs and that the global-font-lock-mode needs to be commented. The indent level default was changed from 4 to 2.</li></ul></li><li>sort out the comment blocks, as it is currently based on ruby, where the symbol # currently denotes the start of a comment, maybe this can be cribbed from java-mode...</li><li>at the moment you have to hit tab to do indents, I'm sure emacs can do this automatically on carriage return...</li></ul><p>Comments regarding Russel's mode:</p><ul><li>Get optional semicolons working properly.</li><li>Get the font-lock colouring a bit more consistent.</li></ul><h3>Disclaimers</h3><ul><li>Jeremy's mode is based upon ruby-mode in ruby stable snapshot - Wed Nov 24 04:01:06 JST 2004. This is just a quick hack of a groovy-mode, so if it's broken for you, fix it and share with the world.</li><li>Russel's mode has "issues" when used with CC Mode 5.31 where groovy-mode is not compiled and CC Mode is.</li></ul><p>jez.<br /> <a href="http://javanicus.com/blog2">http://javanicus.com/blog2</a></p><p>Russel<br /> <a href="http://www.russel.org.uk">http://www.russel.org.uk</a></p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced