shared / .emacs

Full commit
Toby Davies c3d7c1a… 8ec10cb 
Toby Davies 7bd0c85 
Toby Davies 9b6a3e4… 3cd9e48 
Toby Davies 7ea5bc0 

Toby Davies 97360ba 

Toby Davies 7bd0c85 
Toby Davies a87b77f 
Toby Davies 97360ba… ffbf989 
Toby Davies 039b1a7… ffbf989 

Toby Davies 039b1a7… 763a32a 

Toby Davies 039b1a7 

Toby Davies b3f4b04… 8ec10cb 

Toby Davies 9b6a3e4 

Toby Davies 7ea5bc0 
Toby Davies 9b6a3e4 

Toby Davies 97360ba… 8ec10cb 

Toby Davies b33eac2… 8ec10cb 

Toby Davies 4b48ecf… 044b8e4 
Toby Davies 039b1a7 

Toby Davies 7bd0c85 
Toby Davies b33eac2 
Toby Davies 7bd0c85 
Toby Davies a87b77f 

(push "~/.emacs.d" load-path)

(require 'thingatpt)
(require 'ipython)
(require 'flymake)
(require 'flymake-cursor)
(require 'mediawiki)
(require 'autopair)

(defvar autopair-modes '(python-mode))
(defun turn-on-autopair-mode () (autopair-mode 1))
(dolist (mode autopair-modes) (add-hook (intern (concat (symbol-name mode) "-hook")) 'turn-on-autopair-mode))

(setq-default indent-tabs-mode nil)
(setq column-number-mode t)
(show-paren-mode t)

(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(add-to-list 'auto-mode-alist '("\\.pl\\'" . prolog-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(browse-url-browser-function (quote browse-url-generic))
 '(browse-url-generic-program "sensible-browser")
 '(inhibit-startup-screen t)
 '(initial-buffer-choice t)
 '(ispell-dictionary "british")
 '(org-agenda-files (quote ("~/org.d/")))
 '(pop-up-frames nil))

(define-button-type 'apropos-button
  'action 'button-woman
  'follow-link t)

(defun flymake-pyflakes-init ()
  (let* ((temp-file (flymake-init-create-temp-buffer-copy
	 (local-file (file-relative-name
		      (file-name-directory buffer-file-name))))
    (list "pycheck"  (list local-file))))

(add-to-list 'flymake-allowed-file-name-masks
             '("\\.py\\'" flymake-pyflakes-init))

(add-hook 'python-mode-hook
	  (lambda ()
	    (unless (eq buffer-file-name nil)
	      (flymake-mode 1)
	      (local-set-key [f2] 'flymake-goto-prev-error)
	      (local-set-key [f3] 'flymake-goto-next-error))))

(defun woman-at-point ()
  (message (symbol-name (symbol-at-point)))
  (woman (symbol-name (symbol-at-point))))

(defun button-woman (button)
  (woman (button-label button)))

(defun shell-command-buffer (cmd)
  (let ((map (make-sparse-keymap)))
    (switch-to-buffer (generate-new-buffer cmd))
    (display-buffer (current-buffer))
    (insert (shell-command-to-string cmd))))

(defun shell-apropos-buffer (cmd)
  (interactive "s")
  (message cmd)
  (shell-command-buffer (concat "apropos " cmd))
  (while (> (point) 1)
    (forward-line -1)
    (move-to-column 0)
     (- (save-excursion
	  (forward-whitespace 1)
     :type 'apropos-button))
  (goto-char 1)
  (insert "Choose from the available man pages:\n")
  (toggle-read-only 1))

(add-hook 'after-make-frame-functions 'set-mouse-mode-function)

(setq latex-mode-hook 
      '(lambda ()

(defun set-mouse-mode-function (frame)
  (xterm-mouse-mode t)
  (global-set-key [mouse-2] 'clipboard-yank)
  (global-set-key [mouse-4] '(lambda ()
                               (scroll-down 1)))
  (global-set-key [mouse-5] '(lambda ()
                               (scroll-up 1))))