]> git.rkrishnan.org Git - .emacs.d.git/blob - init.el
1e40e81d567c138aae15bb7fa9cd2fddddb5ed9c
[.emacs.d.git] / init.el
1 (setq load-path (cons "~/.emacs.d/emacs" load-path))
2
3 ;; color themes
4 (add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
5 ;(load-theme 'zenburn t)
6
7 (require 'package)
8 (add-to-list 'package-archives 
9     '("marmalade" .
10       "http://marmalade-repo.org/packages/"))
11 (package-initialize)
12
13 (load "my-c-mode.el")
14 (load "my-generic-stuff.el")
15 (load "my-search.el")
16 (load "my-erc.el")
17 ;; (load "my-org-mode.el")
18 ;; (load "my-slime.el")
19 ;; (load "my-twitter.el")
20 ;; (load "my-python.el")
21 ;; (load "my-haskell.el")
22 ;; (load "my-swank-js.el")
23
24 (defun match-paren (arg)
25   "Go to the matching paren if on a paren; otherwise insert %."
26   (interactive "p")
27   (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
28         ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
29         (t (self-insert-command (or arg 1)))))
30
31 ;; highlight parentheses mode
32 (require 'highlight-parentheses)
33
34
35 ;; paredit
36 (autoload 'paredit-mode "paredit"
37   "Minor mode for pseudo-structurally editing Lisp code." t)
38
39 (dolist (hook '(emacs-lisp-mode-hook
40                 lisp-mode-hook
41                 lisp-interaction-mode-hook
42                 clojure-mode-hook
43                 scheme-mode-hook))
44   (add-hook hook #'(lambda ()
45                      (highlight-parentheses-mode t)
46                      (paredit-mode +1))))
47
48 ;; flyspell
49 (autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
50
51 ;; handle trailing whitespaces
52 ;(add-hook 'before-save-hook 'delete-trailing-whitespace)
53
54 ;; update copyright years before saving.
55 ;(add-hook 'before-save-hook 'copyright-update)
56
57 ;; sending email
58 (setq message-send-mail-function 'message-send-mail-with-sendmail
59       mail-specify-envelope-from t      ; Settings to work with msmtp
60       message-sendmail-f-is-evil nil  
61       mail-envelope-from 'header
62       message-sendmail-envelope-from 'header
63       sendmail-program "/usr/bin/msmtp"
64       user-full-name "Ramakrishnan Muthukrishnan")
65
66 (setq message-kill-buffer-on-exit t) ; kill buffer after sending mail)
67
68 ;; notmuch
69 (setq gnus-inhibit-images nil)
70 (add-to-list 'load-path "~/.emacs.d/emacs/notmuch")
71 (setq notmuch-command "~/bin/remote-notmuch.sh")
72 (require 'notmuch)
73 (when (memq window-system '(mac ns))
74   (exec-path-from-shell-initialize)
75   (setq starttls-use-gnutls t)
76   (setq starttls-gnutls-program "gnutls-cli")
77   (setq starttls-extra-arguments nil)
78   )
79 (setq smtpmail-starttls-credentials '(("rkrishnan.org" 587 nil nil))
80       smtpmail-auth-credentials (expand-file-name "~/.authinfo")
81       smtpmail-default-smtp-server "rkrishnan.org"
82       smtpmail-smtp-server "rkrishnan.org"
83       smtpmail-smtp-service 587)
84
85 (setq notmuch-fcc-dirs nil)
86 (add-hook 'message-header-setup-hook
87     (lambda () (insert (format "Bcc: %s <%s>\n"
88                 (notmuch-user-name)
89                 (notmuch-user-primary-email)))))
90
91 ;; addressbook
92 (require 'notmuch-address)
93 (setq notmuch-address-command "~/bin/addrlookup")
94 (notmuch-address-message-insinuate)
95
96 (require 'smtpmail)
97 (setq message-send-mail-function 'smtpmail-send-it)
98 (require 'starttls)
99
100 ;; sign all emails
101 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
102
103 (set-default-font "Inconsolata-11")
104
105 ;; spell check
106 (setq ispell-program-name "aspell"
107   ispell-extra-args '("--sug-mode=ultra"))
108
109 (setq ispell-list-command "--list")
110
111 (dolist (hook '(text-mode-hook))
112   (add-hook hook (lambda () (flyspell-mode 1))))
113 (dolist (hook '(change-log-mode-hook log-edit-mode-hook))
114   (add-hook hook (lambda () (flyspell-mode -1))))
115
116 ;; new wonderful theme monokai
117 (load-theme 'monokai t)