Skip to content

Commit

Permalink
Move 'require-package calls next to the related setup code
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Mar 4, 2013
1 parent 49711f6 commit 2612b9f
Show file tree
Hide file tree
Showing 36 changed files with 172 additions and 129 deletions.
2 changes: 1 addition & 1 deletion init-auto-complete.el
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(require 'auto-complete)
(require-package 'auto-complete)
(require 'auto-complete-config)
(global-auto-complete-mode t)
(setq ac-expand-on-auto-complete nil)
Expand Down
10 changes: 10 additions & 0 deletions init-clojure.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
(require-package 'clojure-mode)
(require-package 'clojure-test-mode)
(require-package 'cljsbuild-mode)
(require-package 'elein)
(require-package 'nrepl)
(require-package 'slamhound)
(require-package 'slime)
(require-package 'ac-nrepl)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Slime with Clojure
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
1 change: 1 addition & 0 deletions init-crontab.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(require-package 'crontab-mode)
(add-auto-mode 'crontab-mode "\\.?cron\\(tab\\)?\\'")

(provide 'init-crontab)
12 changes: 12 additions & 0 deletions init-css.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
(require-package 'mmm-mode)
(require-package 'sass-mode)
(require-package 'scss-mode)
(require-package 'less-css-mode)
(require-package 'flymake-css)
(require-package 'flymake-sass)


(eval-after-load 'mmm-vars
'(progn
(mmm-add-group
Expand Down Expand Up @@ -27,6 +35,10 @@


;; Colourise CSS colour literals
(when (featurep 'color)
;; rainbow-mode needs color.el, bundled with Emacs >= 24.
(require-package 'rainbow-mode))

(eval-after-load 'rainbow-mode
'(dolist (hook '(css-mode-hook html-mode-hook sass-mode-hook))
(add-hook hook 'rainbow-mode)))
Expand Down
6 changes: 4 additions & 2 deletions init-csv.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
(autoload 'csv-mode "csv-mode" "Major mode for editing comma-separated value files." t)
(require-package 'csv-mode)
(require-package 'csv-nav)

(add-auto-mode 'csv-mode "\\.[Cc][Ss][Vv]\\'")
(autoload 'csv-nav-mode "csv-nav-mode" "Major mode for navigating comma-separated value files." t)
(autoload 'csv-nav-mode "csv-nav" "Major mode for navigating comma-separated value files." t)

(setq csv-separators '("," ";" "|" " "))

Expand Down
4 changes: 4 additions & 0 deletions init-darcs.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
(require-package 'darcsum)
(require-package 'vc-darcs)


;; TODO: include this in the vc-darcs ELPA package
(add-to-list 'vc-handled-backends 'DARCS)
(autoload 'vc-darcs-find-file-hook "vc-darcs")
Expand Down
2 changes: 2 additions & 0 deletions init-dired.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(require-package 'dired+)

(eval-after-load 'dired
'(progn
(require 'dired+)
Expand Down
13 changes: 12 additions & 1 deletion init-editing-utils.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
(require-package 'unfill)
(require-package 'whole-line-or-region)

;;----------------------------------------------------------------------------
;; Some basic preferences
;;----------------------------------------------------------------------------
Expand Down Expand Up @@ -53,18 +56,20 @@
;;----------------------------------------------------------------------------
;; Show matching parens
;;----------------------------------------------------------------------------
(require-package 'mic-paren)
(paren-activate) ; activating mic-paren

;;----------------------------------------------------------------------------
;; Expand region
;;----------------------------------------------------------------------------
(require 'expand-region)
(require-package 'expand-region)
(global-set-key (kbd "C-=") 'er/expand-region)


;;----------------------------------------------------------------------------
;; Fix per-window memory of buffer point positions
;;----------------------------------------------------------------------------
(require-package 'pointback)
(global-pointback-mode)
(defadvice skeleton-insert (before disable-pointback activate)
"Disable pointback when using skeleton functions like `sgml-tag'."
Expand Down Expand Up @@ -99,10 +104,13 @@
(global-set-key (kbd "M-T") 'transpose-lines)
(global-set-key (kbd "C-.") 'set-mark-command)
(global-set-key (kbd "C-x C-.") 'pop-global-mark)

(require-package 'ace-jump-mode)
(global-set-key (kbd "C-;") 'ace-jump-mode)
(global-set-key (kbd "C-:") 'ace-jump-word-mode)


(require-package 'multiple-cursors)
;; multiple-cursors
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
Expand Down Expand Up @@ -146,12 +154,14 @@
;;----------------------------------------------------------------------------
;; Page break lines
;;----------------------------------------------------------------------------
(require-package 'page-break-lines)
(global-page-break-lines-mode)

;;----------------------------------------------------------------------------
;; Fill column indicator
;;----------------------------------------------------------------------------
(when (> emacs-major-version 23)
(require-package 'fill-column-indicator)
(defun sanityinc/prog-mode-fci-settings ()
(turn-on-fci-mode)
(when show-trailing-whitespace
Expand Down Expand Up @@ -188,6 +198,7 @@
;;----------------------------------------------------------------------------
;; Shift lines up and down with M-up and M-down
;;----------------------------------------------------------------------------
(require-package 'move-text)
(move-text-default-bindings)


Expand Down
118 changes: 0 additions & 118 deletions init-elpa.el
Original file line number Diff line number Diff line change
Expand Up @@ -96,123 +96,5 @@ ARCHIVE is the string name of the package archive.")

(package-initialize)

(require-package 'ido-ubiquitous)
(when (< emacs-major-version 24)
(require-package 'color-theme))
(require-package 'auto-compile)
(require-package 'auto-complete)
(require-package 'ace-jump-mode)
(require-package 'fill-column-indicator)
(require-package 'multiple-cursors)
(require-package 'expand-region)
(require-package 'tagedit)
(require-package 'gnuplot)
(require-package 'haskell-mode)
(require-package 'magit)
(require-package 'git-gutter-fringe)
(require-package 'git-blame)
(require-package 'git-commit-mode)
(require-package 'gitignore-mode)
(require-package 'gitconfig-mode)
(require-package 'wgrep)
(require-package 'flymake-cursor)
(require-package 'csv-mode)
(require-package 'csv-nav)
(require-package 'json)
(require-package 'js3-mode)
(when (>= emacs-major-version 24)
(require-package 'js2-mode))
(require-package 'lua-mode)
(require-package 'project-local-variables)
(require-package 'ruby-mode)
(require-package 'inf-ruby)
(require-package 'robe)
(require-package 'yari)
(require-package 'yaml-mode)
(require-package 'paredit)
(require-package 'eldoc-eval)
(ignore-errors
(require-package 'erlang))
(require-package 'slime)
(require-package 'slime-fuzzy)
(require-package 'slime-repl)
(require-package 'yagist)
(require-package 'haml-mode)
(require-package 'sass-mode)
(require-package 'scss-mode)
(require-package 'elein)
(require-package 'markdown-mode)
(require-package 'smex)
(require-package 'sql-indent)
(require-package 'dired+)
(when (featurep 'color)
;; rainbow-mode needs color.el, bundled with Emacs >= 24.
(require-package 'rainbow-mode))
(require-package 'maxframe)
(when (< emacs-major-version 24)
(require-package 'org))
(require-package 'org-fstree)
(when *is-a-mac*
(require-package 'org-mac-link-grabber)
(require-package 'org-mac-iCal))
(require-package 'htmlize)
(require-package 'clojure-mode)
(require-package 'clojure-test-mode)
(require-package 'cljsbuild-mode)
(require-package 'nrepl)
(require-package 'slamhound)
(require-package 'diminish)
(require-package 'js-comint)
(require-package 'php-mode)
(require-package 'smarty-mode)
(require-package 'scratch)
(require-package 'mic-paren)
(require-package 'rainbow-delimiters)
(require-package 'todochiku)
(require-package 'marmalade)
(require-package 'textile-mode)
(require-package 'darcsum)
(require-package 'pretty-mode)

;; I maintain this chunk:
(require-package 'ac-slime)
(require-package 'ac-nrepl)
(require-package 'coffee-mode)
(require-package 'color-theme-sanityinc-solarized)
(require-package 'color-theme-sanityinc-tomorrow)
(require-package 'crontab-mode)
(require-package 'dsvn)
(require-package 'elisp-slime-nav)
(require-package 'exec-path-from-shell)
(require-package 'flymake-coffee)
(require-package 'flymake-css)
(require-package 'flymake-haml)
(require-package 'flymake-jslint)
(require-package 'flymake-json)
(require-package 'flymake-php)
(require-package 'flymake-python-pyflakes)
(require-package 'flymake-ruby)
(require-package 'flymake-sass)
(require-package 'flymake-shell)
(require-package 'hippie-expand-slime)
(require-package 'hl-sexp)
(require-package 'ibuffer-vc)
(require-package 'less-css-mode)
(require-package 'lively)
(require-package 'mmm-mode)
(require-package 'move-text)
(require-package 'mwe-log-commands)
(when *is-a-mac*
(require-package 'osx-location))
(require-package 'page-break-lines)
(require-package 'pointback)
(require-package 'regex-tool)
(require-package 'rinari)
(require-package 'ruby-compilation)
(require-package 'session)
(require-package 'tidy)
(require-package 'unfill)
(require-package 'vc-darcs)
(require-package 'whole-line-or-region)

(provide 'init-elpa)
6 changes: 5 additions & 1 deletion init-erlang.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
(require 'erlang-start)
(ignore-errors
(require-package 'erlang))

(when (package-installed-p 'erlang)
(require 'erlang-start))

(provide 'init-erlang)
1 change: 1 addition & 0 deletions init-exec-path.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


(when (memq window-system '(mac ns))
(require-package 'exec-path-from-shell)
(exec-path-from-shell-initialize))

(provide 'init-exec-path)
2 changes: 2 additions & 0 deletions init-flymake.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(require-package 'flymake-cursor)

(setq flymake-gui-warnings-enabled nil)

;; Stop flymake from breaking when ruby-mode is invoked by mmm-mode,
Expand Down
8 changes: 8 additions & 0 deletions init-git.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
(require-package 'magit)
(require-package 'git-gutter-fringe)
(require-package 'git-blame)
(require-package 'git-commit-mode)
(require-package 'gitignore-mode)
(require-package 'gitconfig-mode)
(require-package 'yagist)

(setq magit-save-some-buffers nil
magit-process-popup-time 10
magit-completing-read-function 'magit-ido-completing-read)
Expand Down
2 changes: 2 additions & 0 deletions init-growl.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(require-package 'todochiku)

(require 'todochiku) ;; growl notifications when compilation finishes
(setq todochiku-icons-directory (expand-file-name "~/.emacs.d/site-lisp/todochiku-icons"))

Expand Down
2 changes: 2 additions & 0 deletions init-haml.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(require-package 'haml-mode)
(require-package 'flymake-haml)
(add-hook 'haml-mode-hook 'flymake-haml-load)

(provide 'init-haml)
1 change: 1 addition & 0 deletions init-haskell.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(require-package 'haskell-mode)
(setq haskell-font-lock-symbols t)

(add-hook 'haskell-mode-hook
Expand Down
2 changes: 2 additions & 0 deletions init-ibuffer.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(require-package 'ibuffer-vc)

(defun ibuffer-set-up-preferred-filters ()
(ibuffer-vc-set-filter-groups-by-vc-root)
(unless (eq ibuffer-sorting-mode 'filename/process)
Expand Down
3 changes: 3 additions & 0 deletions init-ido.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
(require-package 'ido-ubiquitous)
(require-package 'smex)

;; Use C-f during file selection to switch to regular find-file
(ido-mode t) ; use 'buffer rather than t to use only buffer switching
(ido-everywhere t)
Expand Down
12 changes: 12 additions & 0 deletions init-javascript.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
(require-package 'json)
(require-package 'js3-mode)
(when (>= emacs-major-version 24)
(require-package 'js2-mode))
(require-package 'js-comint)
(require-package 'rainbow-delimiters)
(require-package 'coffee-mode)
(require-package 'flymake-coffee)
(require-package 'flymake-jslint)
(require-package 'flymake-json)


(defcustom preferred-javascript-mode
(first (remove-if-not #'fboundp '(js2-mode js3-mode)))
"Javascript mode to use for .js files."
Expand Down
9 changes: 9 additions & 0 deletions init-lisp.el
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
(require-package 'elisp-slime-nav)
(require-package 'lively)

(require-package 'pretty-mode)
(autoload 'turn-on-pretty-mode "pretty-mode")

;; ----------------------------------------------------------------------------
;; Paredit
;; ----------------------------------------------------------------------------
(require-package 'paredit)
(autoload 'enable-paredit-mode "paredit")


Expand Down Expand Up @@ -71,6 +76,7 @@
;; Automatic byte compilation
;; ----------------------------------------------------------------------------

(require-package 'auto-compile)
(auto-compile-on-save-mode 1)
;; TODO: also use auto-compile-on-load-mode
;; TODO: exclude .dir-locals.el
Expand All @@ -79,6 +85,8 @@
;; Highlight current sexp
;; ----------------------------------------------------------------------------

(require-package 'hl-sexp)

;; Prevent flickery behaviour due to hl-sexp-mode unhighlighting before each command
(eval-after-load 'hl-sexp
'(defadvice hl-sexp-mode (after unflicker (turn-on) activate)
Expand Down Expand Up @@ -115,6 +123,7 @@
(add-hook hook 'sanityinc/emacs-lisp-setup)))


(require-package 'eldoc-eval)
(require 'eldoc-eval)

(add-to-list 'auto-mode-alist '("\\.emacs-project\\'" . emacs-lisp-mode))
Expand Down
2 changes: 2 additions & 0 deletions init-markdown.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(require-package 'markdown-mode)

(setq auto-mode-alist
(cons '("\\.\\(md\\|markdown\\)\\'" . markdown-mode) auto-mode-alist))

Expand Down
2 changes: 2 additions & 0 deletions init-marmalade.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(require-package 'marmalade)

;;; Handy code for uploading new versions of my own packages to marmalade

(autoload 'marmalade-upload-buffer "marmalade")
Expand Down
Loading

0 comments on commit 2612b9f

Please sign in to comment.