Describe modules
This commit is contained in:
parent
242a7e429d
commit
a48c55294f
1 changed files with 39 additions and 0 deletions
|
@ -10,6 +10,45 @@ require extra steps to enable all functionality. These steps and the
|
||||||
functionality provided by these modules are documented on the
|
functionality provided by these modules are documented on the
|
||||||
following links.
|
following links.
|
||||||
|
|
||||||
|
## What's a module?
|
||||||
|
|
||||||
|
Prelude modules are plain old Elisp libraries - there's absolutely nothing magical about them.
|
||||||
|
Most of them simply install a few package and provide some sensible baseline configuration for them.
|
||||||
|
Here's a real example.
|
||||||
|
|
||||||
|
``` emacs-lisp
|
||||||
|
;;; prelude-ruby.el --- Emacs Prelude: A nice setup for Ruby (and Rails) devs.
|
||||||
|
;;
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'prelude-programming)
|
||||||
|
|
||||||
|
(prelude-require-packages '(inf-ruby yari))
|
||||||
|
|
||||||
|
;; We never want to edit Rubinius bytecode
|
||||||
|
(add-to-list 'completion-ignored-extensions ".rbc")
|
||||||
|
|
||||||
|
(define-key 'help-command (kbd "R") 'yari)
|
||||||
|
|
||||||
|
(with-eval-after-load 'ruby-mode
|
||||||
|
(defun prelude-ruby-mode-defaults ()
|
||||||
|
(inf-ruby-minor-mode +1)
|
||||||
|
;; CamelCase aware editing operations
|
||||||
|
(subword-mode +1))
|
||||||
|
|
||||||
|
(setq prelude-ruby-mode-hook 'prelude-ruby-mode-defaults)
|
||||||
|
|
||||||
|
(add-hook 'ruby-mode-hook (lambda ()
|
||||||
|
(run-hooks 'prelude-ruby-mode-hook))))
|
||||||
|
|
||||||
|
(provide 'prelude-ruby)
|
||||||
|
;;; prelude-ruby.el ends here
|
||||||
|
```
|
||||||
|
|
||||||
|
To use a module you simple have to require it. No new concepts. No magic.
|
||||||
|
|
||||||
|
## List of Modules
|
||||||
|
|
||||||
- C/C++
|
- C/C++
|
||||||
- Clojure
|
- Clojure
|
||||||
- CoffeeScript
|
- CoffeeScript
|
||||||
|
|
Loading…
Reference in a new issue