comparison .elisp/settings/40.modes.el @ 217:e4842709368a

emacs: move colors to their own file and migrate to whitespace from wspace
author Augie Fackler <durin42@gmail.com>
date Sat, 14 Aug 2010 20:42:58 -0500
parents 84eb8c90ada9
children b9b118dba61a
comparison
equal deleted inserted replaced
216:a01712792c2b 217:e4842709368a
15 ;; add hooks for modes you want to use the tab completion for: 15 ;; add hooks for modes you want to use the tab completion for:
16 (set-variable 'af-cleanup-whitespace t) 16 (set-variable 'af-cleanup-whitespace t)
17 (add-hook 'c-mode-hook 'af-tab-fix) 17 (add-hook 'c-mode-hook 'af-tab-fix)
18 (add-hook 'sh-mode-hook 'af-tab-fix) 18 (add-hook 'sh-mode-hook 'af-tab-fix)
19 (add-hook 'emacs-lisp-mode-hook 'af-tab-fix) 19 (add-hook 'emacs-lisp-mode-hook 'af-tab-fix)
20
21 ;; disable whitespace cleanup in modes sensitive to whitespace
20 (defun af-no-clean-whitespace () 22 (defun af-no-clean-whitespace ()
21 (make-variable-buffer-local 'af-cleanup-whitespace) 23 (make-variable-buffer-local 'af-cleanup-whitespace)
22 (set-variable 'af-cleanup-whitespace nil)) 24 (set-variable 'af-cleanup-whitespace nil))
23 (add-hook 'rst-mode-hook 'af-no-clean-whitespace) 25 (add-hook 'rst-mode-hook 'af-no-clean-whitespace)
24 (add-hook 'makefile-mode-hook '(lambda () 26 (add-hook 'makefile-mode-hook 'af-no-clean-whitespace)
25 (af-no-clean-whitespace)
26 (add-hook 'font-lock-mode-hook 'show-ws-highlight-tabs)))
27 27
28 (autoload 'js2-mode "js2" nil t) 28 (autoload 'js2-mode "js2" nil t)
29 (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) 29 (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
30 (add-hook 'js2-mode-hook 'af-tab-fix) 30 (add-hook 'js2-mode-hook 'af-tab-fix)
31 31
43 (add-to-list 'auto-mode-alist '("\\.html.erb$'" . django-html-mode)) 43 (add-to-list 'auto-mode-alist '("\\.html.erb$'" . django-html-mode))
44 (add-to-list 'auto-mode-alist '("\\.rhtml$'" . django-html-mode)) 44 (add-to-list 'auto-mode-alist '("\\.rhtml$'" . django-html-mode))
45 (add-hook 'django-html-mode-hook '(lambda () 45 (add-hook 'django-html-mode-hook '(lambda ()
46 (local-set-key (kbd "RET") 46 (local-set-key (kbd "RET")
47 'reindent-then-newline-and-indent))) 47 'reindent-then-newline-and-indent)))
48
49 (defun af-python-mode-hook () 48 (defun af-python-mode-hook ()
50 ; highlight tabs in Python 49 ; highlight tabs in Python
51 (make-variable-buffer-local 'font-lock-mode-hook) 50 (make-variable-buffer-local 'font-lock-mode-hook)
52 (add-hook 'font-lock-mode-hook 'show-ws-highlight-tabs)
53 (make-variable-buffer-local 'python-indent) 51 (make-variable-buffer-local 'python-indent)
54 (if (and buffer-file-name (string-match "melange" buffer-file-name)) 52 (if (and buffer-file-name (string-match "melange" buffer-file-name))
55 (set-variable 'python-indent 2)) 53 (set-variable 'python-indent 2))
56 (af-tab-fix) 54 (af-tab-fix)
57 (easy-menu-add-item nil '("Python") ["Run All Tests" nosetests-all t] 55 (easy-menu-add-item nil '("Python") ["Run All Tests" nosetests-all t]