changeset 43:f34194cad324

Fix to not strip whitespace in rst, since that format is broken to depend on trailing whitespace in some cases.
author Augie Fackler <durin42@gmail.com>
date Thu, 05 Feb 2009 14:22:07 -0600
parents f0f437b22cea
children 9a3af00d8eaa
files .emacs
diffstat 1 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/.emacs
+++ b/.emacs
@@ -56,10 +56,14 @@ point."
   (local-set-key [tab] 'indent-or-expand))
 
 ;; add hooks for modes you want to use the tab completion for:
+(set-variable 'af-cleanup-whitespace t)
 (add-hook 'c-mode-hook          'af-tab-fix)
 (add-hook 'sh-mode-hook         'af-tab-fix)
 (add-hook 'emacs-lisp-mode-hook 'af-tab-fix)
 (add-hook 'clojure-mode-hook    'af-tab-fix)
+(add-hook 'rst-mode-hook '(lambda ()
+                            (make-variable-buffer-local 'af-cleanup-whitespace)
+                            (set-variable 'af-cleanup-whitespace nil)))
 
 (autoload 'js2-mode "js2" nil t)
 (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
@@ -80,12 +84,12 @@ point."
 ; text-mode tries to use M-s for something other than my save shortcut.
 ; That's evil. Stop it from doing that.
 (add-hook 'text-mode-hook '(lambda ()
-			     (define-key text-mode-map "\M-s"
-			       'save-buffer)))
+                             (define-key text-mode-map "\M-s"
+                               'save-buffer)))
 
 ; Cleanup whitespace before saves.
 (add-hook 'before-save-hook '(lambda ()
-			       (whitespace-cleanup)))
+                               (if af-cleanup-whitespace (whitespace-cleanup))))
 
 ; Disable that startup screen
 (setq inhibit-startup-message t)
@@ -96,11 +100,11 @@ point."
 ; Set some pretty colors that are gentler on my eyes
 (setq default-frame-alist
       '((width . 80)
-	(cursor-color . "white")
-	(cursor-type . box)
-	(foreground-color . "white")
-	(background-color . "black")
-	)
+        (cursor-color . "white")
+        (cursor-type . box)
+        (foreground-color . "white")
+        (background-color . "black")
+        )
       )
 ; always highlight matching paren
 (show-paren-mode 1)