comparison .emacs @ 7:9541f7e47514

Some edits to .emacs after my playing with Clojure, also added Clojure support files.
author Augie Fackler <durin42@gmail.com>
date Sun, 30 Nov 2008 20:50:18 -0600
parents c30d68fbd368
children 6b651c7265f2
comparison
equal deleted inserted replaced
6:66f8fcaee427 7:9541f7e47514
10 (ido-mode t) 10 (ido-mode t)
11 11
12 (require 'show-wspace) 12 (require 'show-wspace)
13 (require 'doctest-mode) 13 (require 'doctest-mode)
14 14
15 ; Clojure
16 (require 'clojure-auto)
17 (setq auto-mode-alist (cons '("\\.clj$" . clojure-mode) auto-mode-alist))
18
15 ; Start the server so that emacsclient will work 19 ; Start the server so that emacsclient will work
16 ; TODO: is there a way to *not* start a server if one was already running? 20 ; TODO: is there a way to *not* start a server if one was already running?
17 (server-start) 21 (server-start)
18 22
19 ; All lines should end in a newline 23 ; All lines should end in a newline
21 25
22 ; disable tabs 26 ; disable tabs
23 (setq tab-width 4) 27 (setq tab-width 4)
24 (setq-default indent-tabs-mode nil) 28 (setq-default indent-tabs-mode nil)
25 29
30 ; use tab for indent or complete
31 (defun indent-or-expand (arg)
32 "Either indent according to mode, or expand the word preceding
33 point."
34 (interactive "*P")
35 (if (and
36 (or (bobp) (= ?w (char-syntax (char-before))))
37 (or (eobp) (not (= ?w (char-syntax (char-after))))))
38 (dabbrev-expand arg)
39 (indent-according-to-mode)))
40
41 (defun af-tab-fix ()
42 (local-set-key [tab] 'indent-or-expand))
43
44 ;; add hooks for modes you want to use the tab completion for:
45 (add-hook 'c-mode-hook 'af-tab-fix)
46 (add-hook 'sh-mode-hook 'af-tab-fix)
47 (add-hook 'emacs-lisp-mode-hook 'af-tab-fix)
48 (add-hook 'clojure-mode-hook 'af-tab-fix)
49
26 (defun af-python-mode-hook () 50 (defun af-python-mode-hook ()
27 ; highlight tabs in Python 51 ; highlight tabs in Python
28 (make-variable-buffer-local 'font-lock-mode-hook) 52 (make-variable-buffer-local 'font-lock-mode-hook)
29 (add-hook 'font-lock-mode-hook 'show-ws-highlight-tabs) 53 (add-hook 'font-lock-mode-hook 'show-ws-highlight-tabs)
30 (make-variable-buffer-local 'python-indent) 54 (make-variable-buffer-local 'python-indent)
31 (if (string-match "melange" buffer-file-name) 55 (if (string-match "melange" buffer-file-name)
32 (set-variable 'python-indent 2)) 56 (set-variable 'python-indent 2))
57 (af-tab-fix)
33 ) 58 )
34 (add-hook 'python-mode-hook 'af-python-mode-hook) 59 (add-hook 'python-mode-hook 'af-python-mode-hook)
35 60
36 ;;pymacs 61 ;;pymacs
37 (setenv "PYTHONPATH" (concat (getenv "HOME") "/unixSoft/lib/python")) 62 (setenv "PYTHONPATH" (concat (getenv "HOME") "/unixSoft/lib/python"))
68 (cursor-type . box) 93 (cursor-type . box)
69 (foreground-color . "white") 94 (foreground-color . "white")
70 (background-color . "black") 95 (background-color . "black")
71 ) 96 )
72 ) 97 )
98 ; always highlight matching paren
99 (show-paren-mode 1)
73 100
74 ;; Desktop mode to remember buffers 101 ;; Desktop mode to remember buffers
75 (load "desktop") 102 (load "desktop")
76 (setq desktop-enable t) 103 (setq desktop-enable t)
77 104