[![Melpa Status](http://melpa.milkbox.net/packages/malabar-mode-badge.svg)](http://melpa.milkbox.net/#/malabar-mode)
# malabar-mode
EMACS integration with the JVM.
malabar-mode is a monir-mode with hooks into Maven that makes
it easy to compile files on the fly and execute Maven build
commands.
NOTE: The java/groovy code has been moved to https://github.com/m0smith/malabar-mode-jar
This is based on a fork of
[buzztaiki's fork](https://github.com/buzztaiki/malabar-mode) of
[espenhw's malabar-mode](https://github.com/espenhw/malabar-mode) which has been merged
back into the master branch. Development of malabar-mode has restarted. This is an attempt to keep it up to date and develop at a modest pace.
You may want to skip to [Installation](#Installation).
## What malabar-mode offers
Since malabar-mode can be used from both java-mode and groovy-mode, we get some things for free:
- Syntax highlighting
- Movement commands (`C-M-f/-b` is a winner; so is `M-f/-b`, especially
with `c-subword-mode` turned on)
- Electric punctuation
There's lots more; and since this is Emacs, you can turn off or modify
anything you don't like.
### But there is more:
- Tight integration with [Maven][]. If you're not using Maven, you
should not consider malabar-mode for now. Adding [gradle support](https://github.com/m0smith/malabar-mode-jar/issues/18) is pending.
- A [Groovy][] console for rapid prototyping and exploratory programming
- [JUnit][] integration, both for running tests standalone and through Maven
- Debugger integration with EMACS built in GUD
- Import help; import one class or all needed classes in the buffer
(with prompting if the class name is ambiguous)
- Extend class / implement interface / override method helpers
- Simplistic refactorings
- See the [Cheat Sheet](src/main/lisp/malabar-cheatsheet.org "Malabar Mode Cheat Sheet")
and more.
<a name="Installation" />
# Installation
## 2.x
There has been a lot of work to rewrite malabar-mode to make it easier to maintain, install and develop. It is currently in a beta stage. Once it has some time to mature, it will be put back into MELPA. Until then, the installation is manual:
- Install groovy (2.3.7 or later). Ubunutu has a real old version. Use GVM to install http://gvmtool.net/
- Install gradle
- Clone https://github.com/alexott/cedet/tree/devel
```
git clone https://github.com/alexott/cedet.git
cd cedet
make all
```
- Install malabar-mode from melpa
- Install emacs package groovy-mode. Do not use marmalade version as it is old.
- Add to .emacs:
```
(load-file "~/projects/cedet/cedet-devel-load.el")
(add-hook 'after-init-hook (lambda ()
(message "activate-malabar-mode")
(activate-malabar-mode)))
(add-hook 'malabar-java-mode-hook 'flycheck-mode)
(add-hook 'malabar-groovy-mode-hook 'flycheck-mode)
```
- in emacs (malabar-run-groovy) or C-u M-x run-groovy - you may need to enter the path to groovysh, especially on Windows
- Edit a java/groovy file in a maven2 project
**NOTE 1.x is no longer supported and no more development will happen on this branch**
The malabar-mode package is now part of
[MELPA](http://melpa.milkbox.net/) thanks to this
[issue](https://github.com/dstu/malabar-mode/issues/1). Make sure you
have the MELPA package archive enabled in your init.el or .emacs and
your package contents are up to date (use `M-x
package-refresh-contents` if you can’t find the malabar-mode package and
you’ve added MELPA to your package archives.
## Prerequisites
### Groovy
Version 2.3.7 or beyond
### Emacs
malabar-mode was originally developed on Emacs 23, but
development now targets Emacs 24.
### CEDET
1. (optional) If you want to mimic the IDEish compile-on-save
behaviour, add the following as well::
(add-hook 'malabar-mode-hook
(lambda ()
(add-hook 'after-save-hook 'malabar-compile-file-silently
nil t)))
# Usage
Update: malabar-mode now has a menu. Yay!
## Java
### What's working
- flycheck integration is working except for the few edge cases where the groovy parser differs from th ejava parser
- cedet integration for java, not working for groovy yet
- unit testing a class or method
Here is a list of available interactive commands, with default
keybindings where applicable:
<dl>
<dt><b>malabar-run-test</b> <span class="classifier">(C-c C-v t)</span></dt>
<dd>Runs the unit tests in the current class. With a prefix args, ask for a method name and only run that test</dd>
<dt><b>semantic-ia-describe-class</b> <span class="classifier">(C-c C-v i)</span></dt>
<dd>Show the public variables and methods on a class</dd>
<dt><b>malabar-semantic-heirarchy</b> <span class="classifier">(C-c C-v h)</span></dt>
<dd>Show super classes and interfaces implemented by a class</dd>
<dt><b>malabar-fully-qualified-class-name-kill-ring-save</b> <span class="classifier">(C-c C-v *)</span></dt>
<dd>Copy the fully qualifed classname of the current buffer to the kill ring</dd>
<dt><b>malabar-which</b> <span class="classifier">(C-c C-v w)</span></dt>
<dd>Returns the jar containing the speficied class</dd>
<dt><b>malabar-import-all</b> <span class="classifier">(C-c C-v z)</span></dt>
<dd>Adds import statements for all unqualified classes in the buffer, as
if by performing <code>malabar-import-one-class</code> on each.</dd>
<dt><b>malabar-import-one-class</b> <span class="classifier">(C-c C-v C-z)</span></dt>
<dd><p>Adds an import statement for a single unqualified class (defaults to
the symbol at point). If more than one class matches the
unqualified name you will be asked which class to import.</p>
<p>The variable <code>malabar-import-excluded-classes-regexp-list</code>
contains a list of regular expressions; if one of these matches the
qualified class name, the class will be excluded from import. The
default value excludes classes from <code>java.lang</code>, JRE internal
classes and inner classes.</p></dd>
<dt><b>ede-edit-file-target</b> <span class="classifier">(C-c C-v C-p)</span></dt>
<dd>Visit the project file, that is the closest file named <code>pom.xml</code>
searching upwards in the directory structure.</dd>
<dt><b>malabar-groovy-send-buffer</b> <span class="classifier">(C-c C-v C-k)</span></dt>
<dd>Send the contents of the current buffer to the running groovy instance. If the buffer is a class rather than a script, prefer <code>malabar-mode-load-class</code></dd>
<dt><b>malabar-stack-trace-buffer</b> <span class="classifier">(C-c C-v C-#)</span></dt>
<dd>Create a new stack trace buffer and optional copy the current region into it. A stack trace buffer parses the stack trace and allows jumping directly to the error in the source file. The stack trace buffer will parse whatever stack trace is pasted into it</dd>
<dt><b>malabar-groovy-send-classpath-of-buffer</b> <span class="classifier">(C-c C-v s)</span></dt>
<dd>For use with <code>malabar-groovy-send-buffer</code> and <code>malabar-mode-load-class</code>, it loads the classpath of the current project into the running groovy buffer. This allows for code in the current project to be used interactively.</dd>
<dt><b>malabar-groovy-send-classpath-element</b> <span class="classifier">(C-c C-v s)</span></dt>
<dd>Add a jar, zip or directory to the running groovy buffer</dd>
<dt><b>malabar-jdb</b> <span class="classifier">(C-c C-v J)</span></dt>
<dd>Start the JDB debugger on the current class.</dd>
<dt>malabar-update-package</dt>
<dd>Updates the package statement of the current buffer to match its place
in the source directory.</dd>
<dt>malabar-implement-interface <span class="classifier">(C-c C-v C-i)</span></dt>
<dd>Prompts for an interface, adds stub implementations of all that
interface's methods and adds the interface to the class's implements
clause.</dd>
<dt>malabar-jump-to-thing <span class="classifier">(C-c C-v C-y)</span></dt>
<dd>Jumps
没有合适的资源?快使用搜索试试~ 我知道了~
EMCS JVM Integration for Java and other JVM based languages.zip
共58个文件
el:34个
md:5个
xml:3个
需积分: 5 0 下载量 170 浏览量
2024-02-04
10:14:53
上传
评论
收藏 155KB ZIP 举报
温馨提示
EMCS JVM Integration for Java and other JVM based languages
资源推荐
资源详情
资源评论
收起资源包目录
EMCS JVM Integration for Java and other JVM based languages.zip (58个子文件)
ahao11111
RELEASE.md 1KB
pom.xml 8KB
doc
2.0
DEPENDENCIES.org 103B
REQ.md 122B
REQ.org 1KB
README.md 14KB
INSTALL.md 919B
src
site
site.xml 301B
test
lisp
test-version.el 3KB
init.el 40B
all-tests.el 2KB
malabar-util.elk 4KB
load-all.el 1KB
elk-test.el 26KB
project
basic
pom.xml 775B
src
test
java
com
software_ninja
AppTest.java 685B
main
java
com
software_ninja
App.java 200B
main
resources
org
grumblesmurf
malabar
SetProjectCommand.properties 876B
pom
classpath-3.1.1.pom 3KB
classpath.pom 1KB
lisp
malabar-cheatsheet.org 6KB
malabar-ede-maven.el 8KB
malabar-variables.el 8KB
malabar-mode-autoloads.el 2KB
malabar-semanticdb.el 4KB
malabar-mode.el 58KB
malabar-abbrevs.el 3KB
malabar-service.el 3KB
malabar-reflection.el 18KB
malabar-import.el 16KB
malabar-util.el 9KB
malabar-project.el 13KB
bin
malabarsh 283B
changelog 1KB
imports.groovy 61B
src.old
main
lisp
aa.el 1KB
malabar-test.el 7KB
malabar-flycheck.el 3KB
wisent-malabar-java.wy 50KB
malabar-variables.el 7KB
wisent-malabar-java-wy.el 54KB
srecode
srecode-getset-java.srt 1KB
malabar-semanticdb.el 7KB
malabar-groovy.el 25KB
malabar-annotations.el 5KB
malabar-mode.el 17KB
malabar-codegen.el 20KB
malabar-abbrevs.el 3KB
malabar-reflection.el 14KB
malabar-refactor.el 6KB
malabar-import.el 16KB
malabar-misc.el 5KB
malabar-util.el 9KB
malabar-jump-to-project.el 2KB
malabar-project.el 9KB
COPYING.txt 18KB
.gitignore 25B
README.md 17KB
共 58 条
- 1
资源评论
码农阿豪
- 粉丝: 9909
- 资源: 1750
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功