4

So I've followed the instructions on the malabar-mode github page.

I have emacs packages set up, with melpa added as a an archive (which is where malabar-mode is). mvm's containing directory is in my exec-path, and I have added the following to my ~/.emacs file, as per the README's instructions:

(setq semantic-default-submodes '(global-semantic-idle-scheduler-mode
                                  global-semanticdb-minor-mode
                                  global-semantic-idle-summary-mode
                                  global-semantic-mru-bookmark-mode))
(semantic-mode 1)
(require 'malabar-mode)
(setq malabar-groovy-lib-dir "/path/to/malabar/lib")
(add-to-list 'auto-mode-alist '("\\.java\\'" . malabar-mode))

However, when I start up emacs, I get:

Warning (initialization): An error occurred while loading `/Users/kalaracey/.emacs':

File error: Cannot open load file, malabar-mode

How can I get malabar mode to work? I am using Emacs 24, which has CEDET built in, so that is why I have added the above code to my ~/.emacs file (as per the instructions).

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
kalaracey
  • 815
  • 1
  • 12
  • 28
  • 2
    You're probably missing `(package-initialize)` at the top of your `~/.emacs`. I just installed `malabar-mode` and it works. – abo-abo Feb 12 '14 at 16:10
  • Out of curiosity, you have changed `(setq malabar-groovy-lib-dir "/path/to/malabar/lib")` to an acutal path on your system? – Orpheus Feb 12 '14 at 16:38
  • You are using the Emacs 23.x instructions rather than the 24. – M Smith Feb 12 '14 at 23:20

1 Answers1

6

malabar-mode was added to MELPA so you do not need to install it by hand anymore.

To install

(add-to-list 'package-archives  
    '("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(package-install 'malabar-mode)
(package-install 'flycheck)      ;; This is optional but nice to have

In .emacs.

Because malabar-mode takes so long to load (over 30 seconds on my box), I have it delay loading until I try and find a .java file.

(defun malabar-mode-bootstrap ()
  (require 'cedet)
  (require 'semantic)
  (load "semantic/loaddefs.el")
  (semantic-mode 1);;
  (require 'malabar-mode)
  (load "malabar-flycheck")

  (malabar-mode)
  (flycheck-mode))

(add-to-list 'auto-mode-alist '("\\.java\\'" . malabar-mode-bootstrap))

Also, take a look at https://github.com/m0smith/maven-pom-mode for editing the pom.xml.

M Smith
  • 1,988
  • 15
  • 28