# HG changeset patch # User Augie Fackler # Date 1233865327 21600 # Node ID f34194cad32471e9a66ea1e75bca9c702269da8b # Parent f0f437b22cea0186d2c8ce91a37712e33b0aebae Fix to not strip whitespace in rst, since that format is broken to depend on trailing whitespace in some cases. diff --git a/.emacs b/.emacs --- 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)