diff --git a/Makefile b/Makefile index f566bd3..e550ed9 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ SOURCE_DIR = $(ROOT) ############################################################################## # Variables -MODE_NAME = scala-mode2 +MODE_NAME = scala-mode # Emacs Lisp ELISP_COMMAND ?= emacs @@ -28,9 +28,10 @@ ELISP_FILES += $(MODE_NAME) ELISP_FILES += $(MODE_NAME)-syntax ELISP_FILES += $(MODE_NAME)-indent ELISP_FILES += $(MODE_NAME)-paragraph +ELISP_FILES += $(MODE_NAME)-prettify-symbols +ELISP_FILES += $(MODE_NAME)-imenu ELISP_FILES += $(MODE_NAME)-fontlock ELISP_FILES += $(MODE_NAME)-map -ELISP_FILES += $(MODE_NAME)-sbt ELISP_SOURCES += $(ELISP_FILES:%=$(SOURCE_DIR)/%.el) PKG_FILE += $(SOURCE_DIR)/$(MODE_NAME)-pkg.el @@ -75,7 +76,6 @@ package: cp $(ELISP_SOURCES) $(PKG_FILE) $(MODE_NAME_VERSION) tar cf $(MODE_NAME_VERSION).tar $(MODE_NAME_VERSION) - ## SCALA LICENSE ## ## Copyright (c) 2002-2011 EPFL, Lausanne, unless otherwise specified. diff --git a/scala-mode-imenu.el b/scala-mode-imenu.el index b02c61a..f06a52e 100644 --- a/scala-mode-imenu.el +++ b/scala-mode-imenu.el @@ -11,12 +11,19 @@ (setq lexical-binding t) (defcustom scala-imenu:should-flatten-index t - "Controls whether or not the imenu index is flattened or hierarchical.") + "Controls whether or not the imenu index is flattened or hierarchical." + :type 'boolean + :safe #'booleanp + :group 'scala) (defcustom scala-imenu:build-imenu-candidate 'scala-imenu:default-build-imenu-candidate - "Controls whether or not the imenu index has definition type information.") + "Controls whether or not the imenu index has definition type information." + :type 'function + :group 'scala) (defcustom scala-imenu:cleanup-hooks nil - "Functions that will be run after the construction of each imenu") + "Functions that will be run after the construction of each imenu" + :type 'hook + :group 'scala) (defun scala-imenu:flatten-list (incoming-list &optional predicate) (when (not predicate) (setq predicate 'listp)) diff --git a/scala-mode-indent.el b/scala-mode-indent.el index aa033fd..d2237bd 100644 --- a/scala-mode-indent.el +++ b/scala-mode-indent.el @@ -863,12 +863,12 @@ comment is outside the comment region. " Indents the line if position is right after a space that is after a word that needs to be indented specially." - ;; magic numbers used 4 = length of "case" + ;; magic numbers used 4 = length of "case", 7 = length of "finally" (when (and (> (current-column) 4) (= (char-before) ?\s) (= (char-syntax (char-before (- (point) 1))) ?w) (save-excursion (backward-char) - (looking-back scala-indent:indent-on-words-re)) + (looking-back scala-indent:indent-on-words-re 7)) (not (nth 8 (syntax-ppss)))) (scala-indent:indent-line-to (scala-indent:calculate-indent-for-line)))) @@ -954,10 +954,10 @@ of a line inside a multi-line comment " (looking-at " *\\*\\($\\|[^/]\\)") (save-excursion (goto-char (max (nth 8 state) (line-beginning-position))) (looking-at "\\s */?\\*"))) - (delete-forward-char 2)) + (delete-char 2)) ((and (nth 4 state) ; row comment (i.e. with //) (looking-at " //")) - (delete-forward-char 3)))) + (delete-char 3)))) (scala-indent:fixup-whitespace))) (provide 'scala-mode-indent) diff --git a/scala-mode-syntax.el b/scala-mode-syntax.el index fc8b68e..1817868 100644 --- a/scala-mode-syntax.el +++ b/scala-mode-syntax.el @@ -983,7 +983,7 @@ not. A list must be either enclosed in parentheses or start with (defun scala-syntax:forward-sexp-or-next-line () (interactive) - (cond ((looking-at "\n") (next-line) (beginning-of-line)) + (cond ((looking-at "\n") (forward-line 1) (beginning-of-line)) (t (forward-sexp)))) (defun scala-syntax:beginning-of-definition () diff --git a/scala-mode.el b/scala-mode.el index 6f5514e..bfe55f3 100644 --- a/scala-mode.el +++ b/scala-mode.el @@ -20,6 +20,9 @@ (require 'scala-mode-imenu) (require 'scala-mode-prettify-symbols) +(defvar fixup-whitespace) ;; for compilation +(defvar delete-indentation) ;; for compilation + ;; Tested only for emacs 24 (unless (<= 24 emacs-major-version) (error