refactored prelude-ruby into several modules

This commit is contained in:
Bozhidar Batsov 2012-04-12 17:11:50 +03:00
parent 072095652f
commit 5b2ef06840
8 changed files with 43 additions and 37 deletions

10
init.el
View file

@ -50,17 +50,20 @@ avoid modifying the configuration there.")
(defvar prelude-vendor-dir (concat prelude-dir "vendor/")
"This directory house Emacs Lisp packages that are not yet available in
ELPA (or Marmalade).")
(defvar prelude-snippets-dir (concat prelude-dir "snippets/")
"This folder houses addition yasnippet bundles distributed with Prelude.")
(defvar prelude-personal-dir (concat prelude-dir "personal/")
"Users of Emacs Prelude are encouraged to keep their personal configuration
changes in this directory. All Emacs Lisp files there are loaded automatically
by Prelude.")
(defvar prelude-snippets-dir (concat prelude-dir "snippets/"))
(defvar prelude-personal-snippets-dir (concat prelude-personal-dir "snippets/"))
(defvar prelude-personal-vendor-dir (concat prelude-personal-dir "vendor/"))
;; add Prelude's directories to Emacs's `load-path'
(add-to-list 'load-path prelude-modules-dir)
(add-to-list 'load-path prelude-vendor-dir)
(add-to-list 'load-path prelude-personal-dir)
(add-to-list 'load-path prelude-personal-vendor-dir)
;; the core stuff
(require 'prelude-packages)
@ -73,11 +76,14 @@ by Prelude.")
;; programming & markup languages support
(require 'prelude-programming)
(require 'prelude-c)
(require 'prelude-css)
(require 'prelude-clojure)
(require 'prelude-coffee)
(require 'prelude-common-lisp)
(require 'prelude-cucumber)
(require 'prelude-emacs-lisp)
(require 'prelude-groovy)
(require 'prelude-haml)
(require 'prelude-haskell)
(require 'prelude-erlang)
(require 'prelude-js)
@ -88,7 +94,9 @@ by Prelude.")
(require 'prelude-python)
(require 'prelude-ruby)
(require 'prelude-scheme)
(require 'prelude-scss)
(require 'prelude-xml)
(require 'prelude-yaml)
;; tools & utilities support
(require 'prelude-ack)

9
modules/prelude-css.el Normal file
View file

@ -0,0 +1,9 @@
(defun prelude-css-mode-defaults ()
(setq css-indent-offset 2)
(rainbow-mode +1))
(setq prelude-css-mode-hook 'prelude-css-mode-defaults)
(add-hook 'css-mode-hook (lambda () (run-hooks 'prelude-css-mode-hook)))
(provide 'prelude-css)

View file

@ -0,0 +1,4 @@
(autoload 'feature-mode "feature-mode" "Feature mode." t)
(add-to-list 'auto-mode-alist '("\\.feature$" . feature-mode))
(provide 'prelude-cucumber)

3
modules/prelude-haml.el Normal file
View file

@ -0,0 +1,3 @@
(add-to-list 'auto-mode-alist '("\\.haml$" . haml-mode))
(provide 'prelude-haml)

View file

@ -48,52 +48,18 @@
(autoload 'inf-ruby-keys "inf-ruby"
"Set local key defs for inf-ruby in ruby-mode")
;; yari provides a nice Emacs interface to ri
(require 'yari)
;; yaml-mode
(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
; TODO fix ruby-end and package ruby-block for marmalade
(require 'ruby-block)
(require 'ruby-end)
(defun prelude-ruby-mode-defaults ()
(inf-ruby-setup-keybindings)
;; turn off the annoying input echo in irb
(setq comint-process-echoes t)
(ruby-block-mode t)
;; bind yari in the local keymap
(local-set-key (kbd "C-h r") 'yari))
(setq prelude-ruby-mode-hook 'prelude-ruby-mode-defaults)
(add-hook 'ruby-mode-hook (lambda () (run-hooks 'prelude-ruby-mode-hook)))
(require 'haml-mode)
(require 'scss-mode)
(defun prelude-css-mode-defaults ()
(setq css-indent-offset 2)
(rainbow-mode +1))
(setq prelude-css-mode-hook 'prelude-css-mode-defaults)
(add-hook 'css-mode-hook (lambda () (run-hooks 'prelude-css-mode-hook)))
(defun prelude-scss-mode-defaults ()
(prelude-css-mode-hook)
;; turn off annoying auto-compile on save
(setq scss-compile-at-save nil))
(setq prelude-scss-mode-hook 'prelude-scss-mode-defaults)
(add-hook 'scss-mode-hook (lambda () (run-hooks 'prelude-scss-mode-hook)))
;; cucumber support
(require 'feature-mode)
(add-to-list 'auto-mode-alist '("\.feature$" . feature-mode))
(provide 'prelude-ruby)
;;; prelude-ruby.el ends here

12
modules/prelude-scss.el Normal file
View file

@ -0,0 +1,12 @@
(require 'prelude-css)
(defun prelude-scss-mode-defaults ()
(prelude-css-mode-hook)
;; turn off annoying auto-compile on save
(setq scss-compile-at-save nil))
(setq prelude-scss-mode-hook 'prelude-scss-mode-defaults)
(add-hook 'scss-mode-hook (lambda () (run-hooks 'prelude-scss-mode-hook)))
(provide 'prelude-scss)

4
modules/prelude-yaml.el Normal file
View file

@ -0,0 +1,4 @@
;; yaml-mode
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
(provide 'prelude-yaml)

@ -1 +1 @@
Subproject commit c80a783ca07e048bc164629dddae2b6fad223f28
Subproject commit 4cd18b27f5bf165b14564f87c4a19633bae1e8c5