Permalink
Browse files

Switch to scala-mode2.

  • Loading branch information...
1 parent 3f54074 commit 27d21ab3de7b3d94c3ef43828edcbe6e9354d174 @bretthoerner committed Nov 25, 2012
View
@@ -76,3 +76,6 @@
[submodule "submodules/logito"]
path = submodules/logito
url = git@github.com:bretthoerner/logito.git
+[submodule "submodules/scala-mode2"]
+ path = submodules/scala-mode2
+ url = git://github.com/hvesalai/scala-mode2.git
View
@@ -100,7 +100,7 @@ makes)."
;; (add-to-list 'load-path (concat dotfiles-dir "auto-complete"))
;; (setq ac-dictionary-directories (list (concat dotfiles-dir "auto-complete/dict"))
;; ac-modes '(emacs-lisp-mode lisp-mode lisp-interaction-mode
-;; slime-repl-mode clojure-mode scheme-mode scala-mode))
+;; slime-repl-mode clojure-mode scheme-mode))
;; (require 'auto-complete-config)
;; (ac-config-default)
@@ -627,12 +627,8 @@ makes)."
(require 'saveplace)
;; scala
-(add-to-list 'load-path (concat dotfiles-dir "scala"))
-(require 'scala-mode-auto)
-(add-to-list 'auto-mode-alist '("\\.scala$" . scala-mode))
-(add-to-list 'load-path "/home/brett/Development/src-mirror/ensime/dist_2.9.2/elisp")
-(when (require 'ensime nil t)
- (add-hook 'scala-mode-hook 'ensime-scala-mode-hook))
+(add-to-list 'load-path (concat dotfiles-dir "scala-mode2"))
+(require 'scala-mode)
;; scpaste
(require 'scpaste)
@@ -738,12 +734,10 @@ makes)."
;; (which-func-mode 1)
;; yasnippet
-(add-to-list 'load-path (concat dotfiles-dir "yasnippet"))
-(require 'yasnippet)
-(setq yas/snippet-dirs '("~/.emacs.d/yasnippet/snippets"))
-(yas-global-mode 1)
-;; (yas/load-directory "~/.emacs.d/yasnippet/snippets")
-
+;; (add-to-list 'load-path (concat dotfiles-dir "yasnippet"))
+;; (require 'yasnippet)
+;; (setq yas/snippet-dirs '("~/.emacs.d/yasnippet/snippets"))
+;; (yas-global-mode 1)
;; diminish (needs to be run after other modes are loaded)
(when (require 'diminish nil 'noerror)
View
View
@@ -1,17 +0,0 @@
-In Emacs, this file should be read in -*- Outline -*- mode.
-
-Below is a list of people who have made changes or contributed to the
-scala emacs mode.
-
-* Main mode developers
-** Michel Schinz <Michel.Schinz at epfl.ch>
-** Anders Bach Nielsen <andersbach.nielsen at epfl.ch>
-
-
-* Contributions
-** Iulian Dragos <dragos at epfl.ch>
-** Stephane Micheloud <michelou at epfl.ch>
-** Victor Rodriguez <victorr at gmail.com>
-** ? <cwitty at newtonlabs.com>
-** Hemant Kumar <gethemant at gmail.com>
-** Ulrick Müller <ulm@gentoo.org>
View
@@ -1,123 +0,0 @@
--*- Outline -*-
-
-* Here is a list of future improvements to the scala mode
-
-** Automatic indentation should work in all cases
-
-
-Automatic indentation is incredibly basic and doesn't work correctly
-in many situations, including:
-
- - multi-line "case" statements, e.g.
-
- case Pair(x,y) =>
- Console.println(x);
- Console.println(y); // not indented correctly
-
- - multi-line "case" patterns, e.g.
-
- case 'a' | 'b' | 'c'
- | 'd' | 'e' | 'f' // not indented correctly
-
- - multi-line comments, e.g.
-
- /*
- * // not indented correctly
- */ // not indented correctly
-
- - other cases of single-line constructs as soon as they span
- multiple lines.
-
-** Implement customize variable to toggle smart indent on/off
-
-** Create templates for normal and scaladoc comments (with menu and shurtcut)
-
-** Scaladoc font-lock mode
-
-** Support for XEmacs
-
-** Add support for Flymode
-
-(require 'scala-mode)
-(require 'compile)
-(require 'flymake)
-(require 'font-lock)
-
-(defvar scala-build-commad nil)
-(make-variable-buffer-local 'scala-build-command)
-
-(add-hook 'scala-mode-hook
- (lambda ()
- (flymake-mode-on)
- ))
-
-(defun flymake-scala-init ()
- (let* ((text-of-first-line (buffer-substring-no-properties (point-min) (min 20 (point-max)))))
- (progn
- (remove-hook 'after-save-hook 'flymake-after-save-hook t)
- (save-buffer)
- (add-hook 'after-save-hook 'flymake-after-save-hook nil t)
- (if (string-match "^//script" text-of-first-line)
- (list "fsc" (list "-Xscript" "MainScript" "-d" "c:/tmp" buffer-file-name))
- (or scala-build-command (list "fsc" (list "-d" "c:/tmp" buffer-file-name))))
- )))
-
-(push '(".+\\.scala$" flymake-scala-init) flymake-allowed-file-name-masks)
-(push '("^\\(.*\\):\\([0-9]+\\): error: \\(.*\\)$" 1 2 nil 3) flymake-err-line-patterns)
-
-(set (make-local-variable 'indent-line-function) 'scala-indent-line)
-
-(defun scala-indent-line ()
- "Indent current line of Scala code."
- (interactive)
- (indent-line-to (max 0 (scala-calculate-indentation))))
-
-(defun scala-calculate-indentation ()
- "Return the column to which the current line should be indented."
- (save-excursion
- (scala-maybe-skip-leading-close-delim)
- (let ((pos (point)))
- (beginning-of-line)
- (if (not (search-backward-regexp "[^\n\t\r ]" 1 0))
- 0
- (progn
- (scala-maybe-skip-leading-close-delim)
- (+ (current-indentation) (* 2 (scala-count-scope-depth (point) pos))))))))
-
-(defun scala-maybe-skip-leading-close-delim ()
- (beginning-of-line)
- (forward-to-indentation 0)
- (if (looking-at "\\s)")
- (forward-char)
- (beginning-of-line)))
-
-(defun scala-face-at-point (pos)
- "Return face descriptor for char at point."
- (plist-get (text-properties-at pos) 'face))
-
-(defun scala-count-scope-depth (rstart rend)
- "Return difference between open and close scope delimeters."
- (save-excursion
- (goto-char rstart)
- (let ((open-count 0)
- (close-count 0)
- opoint)
- (while (and (< (point) rend)
- (progn (setq opoint (point))
- (re-search-forward "\\s)\\|\\s(" rend t)))
- (if (= opoint (point))
- (forward-char 1)
- (cond
-
- ;; Use font-lock-mode to ignore strings and comments
- ((scala-face-at-point (- (point) 1)))
-
- ((looking-back "\\s)")
- (incf close-count))
- ((looking-back "\\s(")
- (incf open-count))
- )))
- (- open-count close-count))))
-
-
-(provide 'scala-extensions)
View
@@ -1,64 +0,0 @@
-############################################################-*-Makefile-*-####
-# Makefile for compiling the major mode of Emacs
-##############################################################################
-
-##############################################################################
-# Configuration
-
-ROOT = .
-
-SOURCE_DIR = $(ROOT)
-
-##############################################################################
-# Variables
-
-# Emacs Lisp
-ELISP_COMMAND ?= emacs
-ELISP_OPTIONS += -batch -no-site-file
-ELISP_OPTIONS += -L $(ROOT)
-ELISP_OPTIONS += -f batch-byte-compile
-
-
-ELISP_FILES += scala-mode
-ELISP_FILES += scala-mode-auto
-ELISP_FILES += scala-mode-inf
-ELISP_FILES += scala-mode-indent
-ELISP_FILES += scala-mode-navigation
-ELISP_FILES += scala-mode-lib
-ELISP_FILES += scala-mode-ui
-ELISP_FILES += scala-mode-fontlock
-ELISP_FILES += scala-mode-constants
-ELISP_FILES += scala-mode-feature
-ELISP_FILES += scala-mode-feature-electric
-ELISP_FILES += scala-mode-feature-speedbar
-ELISP_FILES += scala-mode-feature-tags
-
-ELISP_SOURCES += $(ELISP_FILES:%=$(SOURCE_DIR)/%.el)
-
-##############################################################################
-
-RM ?= rm -f
-TOUCH ?= touch
-
-##############################################################################
-# Commands
-
-all: .latest-build
-
-clean:
- $(RM) *.elc .latest-* autoloads.el
-
-.PHONY: all
-.PHONY: clean
-
-##############################################################################
-# Rules
-
-.latest-build: $(ELISP_SOURCES)
- $(ELISP_COMMAND) $(ELISP_OPTIONS) $(ELISP_SOURCES)
- @$(TOUCH) $@
-
-##############################################################################
-
-autoloads: $(ELISP_SOURCES)
- emacs -batch -q --no-site-file --eval "(setq make-backup-files nil)" --eval "(setq generated-autoload-file (expand-file-name \"autoloads.el\"))" -f batch-update-autoloads `pwd`
View
@@ -1,72 +0,0 @@
-In Emacs, this file should be read in -*- Outline -*- mode.
-
-* Introduction
-
-This directory contains the Emacs mode for Scala programs. This mode
-works only in GNU Emacs 21.1 or later. In particular, it doesn't work
-on any version of XEmacs, or any 20.x version of GNU Emacs.
-
-The mode is currently very basic, and offers:
-
-*** Basic syntax highlighting.
-*** Primitive automatic indentation.
-*** Support for interaction with the Scala interpreter.
-*** Minor mode for inserting ([{" in pairs.
- (scala-mode-electric)
-*** Tags support in Scala mode for creating, loading and completion using tags files.
- The current implementation works with exuberant ctags (http://ctags.sf.net)
- Please see the contrib/ directory for more information.
-*** Simple interaction with speedbar with support for scala files.
- Using the speedbar it is possible to get an overview of the scala
- files and using the emacs tags support, to get an overview of the
- tags in a scala file.
- For this to work please install CEDET (http://cedet.sf.net)
-*** The Scala mode has been cleaned up to work better with yasnippet from
- (http://code.google.com/p/yasnippet/). This replaces the old template stuff
- and the work on scaladoc.
-
-* Installation
-
-Put all ".el" files in a location where Emacs can find them, i.e. a
-directory appearing in the "load-path" variable.
-
- (add-to-list 'load-path "/path/to/some/directory/scala-mode")
-
-It is recommended, but not required to compile all ".el" files to
-".elc" files. This will improve load time in emacs of the scala
-mode. On Linux/UNIX simply run "make" in the scala mode directory.
-
-Add the following line to your Emacs startup file, usually "~/.emacs":
-
- (require 'scala-mode-auto)
-
-If you want to use yasnippets with the scala mode there are some things you need to do.
-First of all install yasnippets from http://code.google.com/p/yasnippet/ (the non-bundle version)
-
-Now add the following to your .emacs file to pick up the scala snippets
-
- (setq yas/my-directory "/path/to/some/directory/scala-mode/contrib/yasnippet/snippets")
- (yas/load-directory yas/my-directory)
-
-And then add this to your .emacs file
-
- (add-hook 'scala-mode-hook
- '(lambda ()
- (yas/minor-mode-on)
- ))
-
-Restart Emacs or evaluate the above line.
-
-From that point on, loading a file whose name ends in ".scala"
-automatically turns Scala mode on. It can also be turned on manually
-using the "scala-mode" command.
-
-The get the best expirience from using the scala mode in emacs, please
-visit the costumization options for the scala mode.
-
-
-* Future plans
-
-See FUTURE file for a list of future enhancements to the scala emacs
-mode. If there is something missing, please post comment on
-scala-tools@listes.epfl.ch.
Oops, something went wrong. Retry.

0 comments on commit 27d21ab

Please sign in to comment.