branch: elpa/scala-mode commit a1ea0b73ddac63e1340e20fd57db5eeeae15033b Author: Heikki Vesalainen <heikkivesalai...@yahoo.com> Commit: Heikki Vesalainen <heikkivesalai...@yahoo.com>
Proper instructions and autoload settings for package-based install --- README.md | 19 +++---------------- scala-mode2-indent.el | 4 ++++ scala-mode2-pkg.el | 4 ++-- scala-mode2.el | 10 +++++----- 4 files changed, 14 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 6f63169..c6c274f 100644 --- a/README.md +++ b/README.md @@ -40,22 +40,9 @@ to the load-path and then to require it. For more information regarding (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) - ``` - - Once the location of the package repository has been added to your - Emacs config, simply navigate to the package view within Emacs, or use - `M-x package-list-packages` to list the available packages. - Mark the package `scala-mode2` and execute the actions (`X`) to install - the mode. - - The remaining config that is required is to edit the Emacs config - to activate the mode: - - ``` - (add-to-list 'auto-mode-alist - '("\\.scala" . scala-mode2) - '("\\.sbt\\'" . scala-mode2) - ) + (package-initialize) + (unless (package-installed-p 'scala-mode2) + (package-refresh-contents) (package-install 'scala-mode2)) ``` 2. Manual: diff --git a/scala-mode2-indent.el b/scala-mode2-indent.el index 3ba69b9..d947828 100644 --- a/scala-mode2-indent.el +++ b/scala-mode2-indent.el @@ -5,6 +5,10 @@ (require 'scala-mode2-syntax) (require 'scala-mode2-lib) +(eval-when-compile + (defvar scala-indent:effective-run-on-strategy) + (defvar scala-indent:previous-indent-pos)) + (defcustom scala-indent:step 2 "The number of spaces an indentation step should be. The actual indentation will be one or two steps depending on context." diff --git a/scala-mode2-pkg.el b/scala-mode2-pkg.el index 6bc2b08..986ff4d 100644 --- a/scala-mode2-pkg.el +++ b/scala-mode2-pkg.el @@ -1,2 +1,2 @@ -(define-package "scala-mode2" "0.2" - "Major mode for editing Scala >= 2.9") +(define-package "scala-mode2" "20130219.1022" "Major mode for editing Scala >= 2.9 [source: github]" 'nil) + diff --git a/scala-mode2.el b/scala-mode2.el index 65a8a0d..c53765f 100644 --- a/scala-mode2.el +++ b/scala-mode2.el @@ -101,11 +101,11 @@ When started, runs `scala-mode-hook'. ) ;; Attach .scala files to the scala-mode -(add-to-list 'auto-mode-alist '("\\.sbt\\'" . scala-mode)) -(modify-coding-system-alist 'file "\\.sbt\\'" 'utf-8) - -(add-to-list 'auto-mode-alist '("\\.scala\\'" . scala-mode)) -(modify-coding-system-alist 'file "\\.scala\\'" 'utf-8) +;;;###autoload +(progn + (add-to-list 'auto-mode-alist + '("\\.\\(scala\\|sbt\\)\\'" . scala-mode)) + (modify-coding-system-alist 'file "\\.\\(scala\\|sbt\\)\\'" 'utf-8)) (provide 'scala-mode2) ;;; scala-mode2.el ends here