From 02b3f27e65ae6e213c8046d3196eacb24630600f Mon Sep 17 00:00:00 2001
From: Bozhidar Batsov <bozhidar@tradeo.com>
Date: Tue, 12 Mar 2013 21:56:21 +0200
Subject: [PATCH] Cleaned up some requires here and there

---
 core/prelude-editor.el  | 30 ++++++++++++++++--------------
 init.el                 |  2 --
 modules/prelude-perl.el |  2 ++
 modules/prelude-xml.el  |  2 ++
 4 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/core/prelude-editor.el b/core/prelude-editor.el
index 9ddc66c..4136e3d 100644
--- a/core/prelude-editor.el
+++ b/core/prelude-editor.el
@@ -98,6 +98,9 @@
 ;; smart pairing for all
 (electric-pair-mode t)
 
+;; diminish keeps the modeline tidy
+(require 'diminish)
+
 ;; meaningful names for buffers with the same name
 (require 'uniquify)
 (setq uniquify-buffer-name-style 'forward)
@@ -106,12 +109,13 @@
 (setq uniquify-ignore-buffers-re "^\\*") ; don't muck with special buffers
 
 ;; saveplace remembers your location in a file when saving files
+(require 'saveplace)
 (setq save-place-file (expand-file-name "saveplace" prelude-savefile-dir))
 ;; activate it for all buffers
 (setq-default save-place t)
-(require 'saveplace)
 
 ;; savehist keeps track of some history
+(require 'savehist)
 (setq savehist-additional-variables
       ;; search entries
       '(search ring regexp-search-ring)
@@ -119,21 +123,14 @@
       savehist-autosave-interval 60
       ;; keep the home clean
       savehist-file (expand-file-name "savehist" prelude-savefile-dir))
-(savehist-mode t)
+(savehist-mode +1)
 
 ;; save recent files
+(require 'recentf)
 (setq recentf-save-file (expand-file-name "recentf" prelude-savefile-dir)
       recentf-max-saved-items 200
       recentf-max-menu-items 15)
-(recentf-mode t)
-
-;; time-stamps
-;; when there's "Time-stamp: <>" in the first 10 lines of the file
-(setq time-stamp-active t
-      ;; check first 10 buffer lines for Time-stamp: <>
-      time-stamp-line-limit 10
-      time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S (%u)") ; date format
-(add-hook 'write-file-hooks 'time-stamp) ; update when saving
+(recentf-mode +1)
 
 ;; use shift + arrow keys to switch between visible buffers
 (require 'windmove)
@@ -163,8 +160,9 @@
 (add-hook 'mouse-leave-buffer-hook 'prelude-auto-save-command)
 
 ;; show-paren-mode: subtle highlighting of matching parens (global-mode)
-(show-paren-mode +1)
+(require 'paren)
 (setq show-paren-style 'parenthesis)
+(show-paren-mode +1)
 
 ;; highlight the current line
 (global-hl-line-mode +1)
@@ -196,7 +194,7 @@
 (setq tramp-default-method "ssh")
 
 ;; ido-mode
-(ido-mode t)
+(require 'ido)
 (setq ido-enable-prefix nil
       ido-enable-flex-matching t
       ido-create-new-buffer 'always
@@ -204,6 +202,7 @@
       ido-max-prospects 10
       ido-save-directory-list-file (expand-file-name "ido.hist" prelude-savefile-dir)
       ido-default-file-method 'selected-window)
+(ido-mode +1)
 
 ;; auto-completion in minibuffer
 (icomplete-mode +1)
@@ -211,9 +210,9 @@
 (set-default 'imenu-auto-rescan t)
 
 ;; flyspell-mode does spell-checking on the fly as you type
+(require 'flyspell)
 (setq ispell-program-name "aspell" ; use aspell instead of ispell
       ispell-extra-args '("--sug-mode=ultra"))
-(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
 
 (defun prelude-enable-flyspell ()
   (when (and prelude-flyspell (executable-find ispell-program-name))
@@ -240,6 +239,7 @@
 (require 'expand-region)
 
 ;; bookmarks
+(require 'bookmark)
 (setq bookmark-default-file (expand-file-name "bookmarks" prelude-savefile-dir)
       bookmark-save-flag 1)
 
@@ -285,6 +285,7 @@
 (put 'dired-find-alternate-file 'disabled nil)
 
 ;; ediff - don't start another frame
+(require 'ediff)
 (setq ediff-window-setup-function 'ediff-setup-windows-plain)
 
 ;; clean up obsolete buffers automatically
@@ -336,6 +337,7 @@ indent yanked text (with prefix arg don't indent)."
           'executable-make-buffer-file-executable-if-script-p)
 
 ;; whitespace-mode config
+(require 'whitespace)
 (setq whitespace-line-column 80) ;; limit line length
 (setq whitespace-style '(face tabs empty trailing lines-tail))
 
diff --git a/init.el b/init.el
index c409bfc..dd92066 100644
--- a/init.el
+++ b/init.el
@@ -91,8 +91,6 @@ by Prelude.")
   (require 'prelude-osx))
 
 ;; the modules
-(require 'prelude-programming)
-
 (when (file-exists-p prelude-modules-file)
   (load prelude-modules-file))
 
diff --git a/modules/prelude-perl.el b/modules/prelude-perl.el
index a5b59ec..875c774 100644
--- a/modules/prelude-perl.el
+++ b/modules/prelude-perl.el
@@ -32,6 +32,8 @@
 
 ;;; Code:
 
+(require 'prelude-programming)
+
 ;; use cperl-mode instead of perl-mode
 (defalias 'perl-mode 'cperl-mode)
 
diff --git a/modules/prelude-xml.el b/modules/prelude-xml.el
index 3326781..09b7b0d 100644
--- a/modules/prelude-xml.el
+++ b/modules/prelude-xml.el
@@ -32,6 +32,8 @@
 
 ;;; Code:
 
+(require 'nxml-mode)
+
 (push '("<\\?xml" . nxml-mode) magic-mode-alist)
 
 ;; pom files should be treated as xml files