Mercurial > dotfiles
comparison .emacs @ 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 | 6e65d45edbbe |
children | ac7a8f9a0924 |
comparison
equal
deleted
inserted
replaced
42:f0f437b22cea | 43:f34194cad324 |
---|---|
54 | 54 |
55 (defun af-tab-fix () | 55 (defun af-tab-fix () |
56 (local-set-key [tab] 'indent-or-expand)) | 56 (local-set-key [tab] 'indent-or-expand)) |
57 | 57 |
58 ;; add hooks for modes you want to use the tab completion for: | 58 ;; add hooks for modes you want to use the tab completion for: |
59 (set-variable 'af-cleanup-whitespace t) | |
59 (add-hook 'c-mode-hook 'af-tab-fix) | 60 (add-hook 'c-mode-hook 'af-tab-fix) |
60 (add-hook 'sh-mode-hook 'af-tab-fix) | 61 (add-hook 'sh-mode-hook 'af-tab-fix) |
61 (add-hook 'emacs-lisp-mode-hook 'af-tab-fix) | 62 (add-hook 'emacs-lisp-mode-hook 'af-tab-fix) |
62 (add-hook 'clojure-mode-hook 'af-tab-fix) | 63 (add-hook 'clojure-mode-hook 'af-tab-fix) |
64 (add-hook 'rst-mode-hook '(lambda () | |
65 (make-variable-buffer-local 'af-cleanup-whitespace) | |
66 (set-variable 'af-cleanup-whitespace nil))) | |
63 | 67 |
64 (autoload 'js2-mode "js2" nil t) | 68 (autoload 'js2-mode "js2" nil t) |
65 (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) | 69 (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) |
66 (add-hook 'js2-mode-hook 'af-tab-fix) | 70 (add-hook 'js2-mode-hook 'af-tab-fix) |
67 | 71 |
78 | 82 |
79 | 83 |
80 ; text-mode tries to use M-s for something other than my save shortcut. | 84 ; text-mode tries to use M-s for something other than my save shortcut. |
81 ; That's evil. Stop it from doing that. | 85 ; That's evil. Stop it from doing that. |
82 (add-hook 'text-mode-hook '(lambda () | 86 (add-hook 'text-mode-hook '(lambda () |
83 (define-key text-mode-map "\M-s" | 87 (define-key text-mode-map "\M-s" |
84 'save-buffer))) | 88 'save-buffer))) |
85 | 89 |
86 ; Cleanup whitespace before saves. | 90 ; Cleanup whitespace before saves. |
87 (add-hook 'before-save-hook '(lambda () | 91 (add-hook 'before-save-hook '(lambda () |
88 (whitespace-cleanup))) | 92 (if af-cleanup-whitespace (whitespace-cleanup)))) |
89 | 93 |
90 ; Disable that startup screen | 94 ; Disable that startup screen |
91 (setq inhibit-startup-message t) | 95 (setq inhibit-startup-message t) |
92 | 96 |
93 ; Basically everything I do is in version control, stop saving backup files | 97 ; Basically everything I do is in version control, stop saving backup files |
94 (setq make-backup-files nil) | 98 (setq make-backup-files nil) |
95 | 99 |
96 ; Set some pretty colors that are gentler on my eyes | 100 ; Set some pretty colors that are gentler on my eyes |
97 (setq default-frame-alist | 101 (setq default-frame-alist |
98 '((width . 80) | 102 '((width . 80) |
99 (cursor-color . "white") | 103 (cursor-color . "white") |
100 (cursor-type . box) | 104 (cursor-type . box) |
101 (foreground-color . "white") | 105 (foreground-color . "white") |
102 (background-color . "black") | 106 (background-color . "black") |
103 ) | 107 ) |
104 ) | 108 ) |
105 ; always highlight matching paren | 109 ; always highlight matching paren |
106 (show-paren-mode 1) | 110 (show-paren-mode 1) |
107 | 111 |
108 ;; Automatically revert unedited files that change on the underlying | 112 ;; Automatically revert unedited files that change on the underlying |