Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
rbolkey committed Dec 2, 2011
2 parents b0b374c + 853a0f8 commit 22ca49eb54945a53b1bb77142fa4cbe21dec131e
Showing with 72 additions and 35 deletions.
  1. +26 −11 README.markdown
  2. +1 −1 init.el
  3. +5 −2 starter-kit-defuns.el
  4. +1 −1 starter-kit-elpa.el
  5. +37 −19 starter-kit-js.el
  6. +2 −1 starter-kit-ruby.el
@@ -47,6 +47,23 @@ Note that having a ~/.emacs file might override the starter kit
loading, so if you've having trouble loading it, make sure that file
is not present.
+## Future
+Work is in progress on
+[version 2 of the Starter Kit](,
+which is structured as a set of packages rather than a git repository
+you use wholesale as your dotfiles. This allows for greater
+modularity: support for each language may be installed separately, and
+once package.el becomes more widespread it should make installation
+much easier.
+Version 2 is not quite ready for general consumption, though
+adventurous users are welcome to try it. Note that it requires Emacs
+version 24, which is still in development.
+If you have ideas for improvements to the Starter Kit, please base
+them on the v2 branch.
## Structure
The init.el file is where everything begins. It's the first file to
@@ -94,22 +111,20 @@ it's difficult to test in it, and breakage is common.
## Contributing
+Please see the note re: "Future" above; active development is only
+happening on the "v2" branch.
If you know your way around Emacs, please try out the starter kit as a
replacement for your regular dotfiles for a while. If there's anything
you just can't live without, add it or let me know so I can add
it. Take a look at what happens in init.el to get started.
-Also: see the file TODO. Helping submit new libraries to Marmalade is the
-easiest way to help out. There are two ways you can do this: either
-take new libraries and make them ready for Marmalade, dropping them in the
-elpa-to-submit directory or take files that are already in
-elpa-to-submit, ensuring all their dependencies are correctly loaded
-into Marmalade, and uploading them. Grep the project for TODO for other things.
+Also: Helping submit new libraries to Marmalade is the easiest way to
+help out. This involves ensuring the library's dependencies are all
+already packaged and then adding the appropriate package headers and
+autoload comments. It's best to contact the package maintainer to ask
+them if they mind having their software distributed on Marmalade. It's
+also ideal to push your autoload/header changes back upstream.
Files are licensed under the same license as Emacs unless otherwise
specified. See the file COPYING for details.
-The latest version is at
-On Unix, /home/$USER/.emacs.d, on windows Documents and Settings/%your
-user name%/Application Data
@@ -72,8 +72,8 @@
(add-to-list 'load-path user-specific-dir)
(if (file-exists-p system-specific-config) (load system-specific-config))
-(if (file-exists-p user-specific-config) (load user-specific-config))
(if (file-exists-p user-specific-dir)
(mapc #'load (directory-files user-specific-dir nil ".*el$")))
+(if (file-exists-p user-specific-config) (load user-specific-config))
;;; init.el ends here
@@ -92,6 +92,9 @@ Symbols matching the text at point are put first in the completion list."
(defun turn-off-tool-bar ()
(tool-bar-mode -1))
+(defun turn-on-idle-highlight ()
+ (idle-highlight-mode t))
(defun add-watchwords ()
nil '(("\\<\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\):"
@@ -103,7 +106,7 @@ Symbols matching the text at point are put first in the completion list."
(add-hook 'coding-hook 'turn-on-save-place-mode)
(add-hook 'coding-hook 'pretty-lambdas)
(add-hook 'coding-hook 'add-watchwords)
-(add-hook 'coding-hook 'idle-highlight)
+(add-hook 'coding-hook 'turn-on-idle-highlight)
(defun run-coding-hook ()
"Enable things that are convenient across all coding buffers."
@@ -215,7 +218,7 @@ Symbols matching the text at point are put first in the completion list."
(paredit-mode 1))
(defun esk-space-for-delimiter? (endp delimiter)
- (not (member major-mode '(ruby-mode espresso-mode js2-mode))))
+ (not (member major-mode '(ruby-mode espresso-mode js-mode js2-mode))))
(eval-after-load 'paredit
'(add-to-list 'paredit-space-for-delimiter-predicates
@@ -4,7 +4,7 @@
(require 'cl)
-(defvar starter-kit-packages (list 'idle-highlight
+(defvar starter-kit-packages (list 'idle-highlight-mode
@@ -2,27 +2,45 @@
;; Part of the Emacs Starter Kit
-(autoload 'espresso-mode "espresso" "Start espresso-mode" t)
-(add-to-list 'auto-mode-alist '("\\.js$" . espresso-mode))
-(add-to-list 'auto-mode-alist '("\\.json$" . espresso-mode))
-(add-hook 'espresso-mode-hook 'moz-minor-mode)
-(add-hook 'espresso-mode-hook 'esk-paredit-nonlisp)
-(add-hook 'espresso-mode-hook 'run-coding-hook)
-(setq espresso-indent-level 2)
+;; NB: js-mode is part of Emacs since version 23.2 (with an alias
+;; javascript-mode). It is derived and updated from Espresso mode.
-;; If you prefer js2-mode, use this instead:
-;; (add-to-list 'auto-mode-alist '("\\.js$" . espresso-mode))
+(defvar esk-js-mode-hook nil)
+(defun run-esk-js-mode-hook ()
+ (run-hooks 'esk-js-mode-hook))
-(eval-after-load 'espresso
- '(progn (define-key espresso-mode-map "{" 'paredit-open-curly)
- (define-key espresso-mode-map "}" 'paredit-close-curly-and-newline)
- ;; fixes problem with pretty function font-lock
- (define-key espresso-mode-map (kbd ",") 'self-insert-command)
- (font-lock-add-keywords
- 'espresso-mode `(("\\(function *\\)("
- (0 (progn (compose-region (match-beginning 1)
- (match-end 1) "ƒ")
- nil)))))))
+(defmacro esk-configure-javascript (name)
+ (let ((sym (intern name))
+ (mode (intern (concat name "-mode")))
+ (hook (intern (concat name "-mode-hook")))
+ (keymap (intern (concat name "-mode-map")))
+ (indent (intern (concat name "-indent-level"))))
+ `(progn
+ (autoload ',mode ,name ,(concat "Start " name "-mode") t)
+ (add-to-list 'auto-mode-alist '("\\.js$" . ,mode))
+ (add-to-list 'auto-mode-alist '("\\.json$" . ,mode))
+ (add-hook ',hook 'moz-minor-mode)
+ (add-hook ',hook 'esk-paredit-nonlisp)
+ (add-hook ',hook 'run-coding-hook)
+ (add-hook ',hook 'run-esk-js-mode-hook)
+ (setq ,indent 2)
+ (eval-after-load ',sym
+ '(progn (define-key ,keymap "{" 'paredit-open-curly)
+ (define-key ,keymap "}" 'paredit-close-curly-and-newline)
+ (define-key ,keymap (kbd ",") 'self-insert-command))))))
+(defun pretty-functions ()
+ (font-lock-add-keywords
+ nil `(("\\(function *\\)("
+ (0 (progn (compose-region (match-beginning 1)
+ (match-end 1) "ƒ")
+ nil))))))
+(add-hook 'esk-js-mode-hook 'pretty-functions)
+(if (< (string-to-number emacs-version) 23.2)
+ (esk-configure-javascript "espresso")
+ (esk-configure-javascript "js"))
(provide 'starter-kit-js)
;;; starter-kit-js.el ends here
@@ -23,8 +23,9 @@
(add-to-list 'auto-mode-alist '("Capfile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Vagrantfile$" . ruby-mode))
-;; We never want to edit Rubinius bytecode
+;; We never want to edit Rubinius bytecode or MacRuby binaries
(add-to-list 'completion-ignored-extensions ".rbc")
+(add-to-list 'completion-ignored-extensions ".rbo")
;;; Rake

0 comments on commit 22ca49e

Please sign in to comment.