 
 ;; smtp mail
 ;; http://obfuscatedcode.wordpress.com/2007/04/26/configuring-emacs-for-gmails-smtp/
-(setq user-mail-address "alex.kritikos@gmail.com")
-(setq user-full-name "Alex Kritikos")
-(setq send-mail-function 'smtpmail-send-it
-      message-send-mail-function 'smtpmail-send-it
-      smtpmail-starttls-credentials
-      '(("smtp.gmail.com" 587 nil nil))
-      smtpmail-auth-credentials
-      (expand-file-name "~/.authinfo")
+(setq user-mail-address            "alex.kritikos@gmail.com"
+      user-full-name "Alex         Kritikos"
+      send-mail-function           'smtpmail-send-it
+      message-send-mail-function   'smtpmail-send-it
+      smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
+      smtpmail-auth-credentia      (expand-file-name "~/.authinfo")
       smtpmail-default-smtp-server "smtp.gmail.com"
-      smtpmail-smtp-server "smtp.gmail.com"
-      smtpmail-smtp-service 587
-      smtpmail-debug-info t)
+      smtpmail-smtp-server         "smtp.gmail.com"
+      smtpmail-smtp-service        587
+      smtpmail-debug-info          t)
 (autoload 'compose-mail "smtpmail")
-(load "abbrevs" 'noerror)
 (add-hook 'mail-mode-hook 'mail-abbrevs-setup)
 
 ;; wanderlust
 (autoload 'wl "wl" "Wanderlust" t)
 (autoload 'wl-other-frame "wl" "Wanderlust on new frame." t)
 (autoload 'wl-draft "wl-draft" "Write draft with Wanderlust." t)
-
-;; IMAP
-;;(setq elmo-imap4-default-server "imap.gmail.com")
-;;(setq elmo-imap4-default-user "alex.kritikos@gmail.com")
-;;(setq elmo-imap4-default-authenticate-type 'clear)
-;;(setq elmo-imap4-default-port '993)
-;;(setq elmo-imap4-default-stream-type 'ssl)
-;;(setq elmo-imap4-use-modified-utf7 t)
-
 (autoload 'wl-user-agent-compose "wl-draft" nil t)
 (if (boundp 'mail-user-agent)
     (setq mail-user-agent 'wl-user-agent))

(autoload 'gist-region-private "gist" "Gist" t)
(autoload 'gist-region-or-buffer "gist" "Gist" t)
(autoload 'gist-region-or-buffer-private "gist" "Gist" t)
(setq gist-view-gist t)

;; Highlight the current line
(global-hl-line-mode t)
(set-face-background 'hl-line "#eeeeee")


;; Rebind keys
(global-set-key "\C-x\C-k" 'kill-region)
(global-set-key (kbd "C-o") 'find-file)
(global-set-key (kbd "C-b") 'switch-to-buffer)
(global-set-key (kbd "C-n") 'make-frame-command)
;; I'd like to use this, but it sometimes gets dead errors
;; (global-set-key (kbd "C-w") 'kill-this-buffer)
(global-set-key (kbd "C-w") 'ido-kill-buffer)
(global-set-key (kbd "C-<return>") 'anything)
(global-set-key (kbd "C-f") 'isearch-forward)
(define-key isearch-mode-map (kbd "C-f") 'isearch-repeat-forward)
(global-set-key (kbd "C-s") 'save-buffer)
(global-set-key (kbd "C-/") 'comment-or-uncomment-region)
(global-set-key (kbd "C-!") 'shell-command)
(global-set-key (kbd "C-|") 'shell-command-on-region)

;; Hippie expansion
(global-set-key (kbd "C-SPC") (make-hippie-expand-function
                             '(try-complete-file-name-partially
                               try-complete-file-name
                               try-expand-dabbrev) t))

;; add a column of numbers
(defun sum-column()

  (interactive)
  (save-excursion
    (if (and (not (= (current-column) 0))
             (re-search-backward "[ \t]" 0 t ))
        (forward-char))
    (let ((retn 0)
          (old-column (current-column))
          (old-next-line-add-newlines))
      (setq next-line-add-newlines nil)
      (while (not
              (looking-at "^[ \t]*$"))
        (move-to-column old-column t)
        (if (and (looking-at "-?[0123456789]+")
                 (eq (current-column) old-column))
            (setq retn (+ retn (string-to-number (current-word)))))
        (next-line)
        (beginning-of-line))
      (next-line)
      (next-line)
      (move-end-of-line 0)
