Merge branch 'master' of git.ganneff.de:emacs
[emacs.git] / .emacs.d / init.el
1 ;; Added by Package.el. This must come before configurations of
2 ;; installed packages. Don't delete this line. If you don't want it,
3 ;; just comment it out by adding a semicolon to the start of the line.
4 ;; You may delete these explanatory comments.
5 ;(package-initialize)
6
7 ;; Ganneff's emacs config
8
9 ;; Emacs can not read its config directly from org-mode files.
10 ;; But as my config nearly completly is inside an org-mode file,
11 ;; emacs need to be told to deal with it.
12 ;; Meet org-tangle/org-babel-load-file, which extracts the emacs-lisp
13 ;; source parts of my config files, writes them into .el files
14 ;; and then lets emacs load those.
15
16 ;; That way I have a nice environment to edit and comment - and easily export
17 ;; to web or elsewhere - while emacs has its elisp. The initial run after
18 ;; a config change takes longer, but as that only happens when I change
19 ;; something in the .org files - I don't care.
20
21 (let ((file-name-handler-alist nil))
22
23 ;; Go go go
24 (unless noninteractive
25 (message "Emacs is powering up... Be patient, Master %s!" (getenv "USER")))
26
27 ;; I like to see how long it takes to "boot" emacs (usually one or two
28 ;; seconds), so save the start time
29 (defvar emacs-load-start-time (current-time))
30
31
32 ; Much larger threshold for garbage collection prevents it to run too often.
33 (setq gc-cons-threshold 480000000)
34
35 ;; Set a high number of lines for the message buffer so stuff doesn't "scroll out"
36 (setq message-log-max 16384)
37
38 ;; Set path to (my, recent) Org-Mode version
39 (add-to-list 'load-path (concat (file-name-directory (or load-file-name (buffer-file-name))) "elisp/org/"))
40 ;; org-mode can load modules when it loads itself, lets tell it which ones we want.
41 ; org-checklist
42 (setq org-modules (quote
43 (org-bbdb org-bibtex org-crypt org-docview org-gnus
44 org-id org-info org-habit org-inlinetask
45 org-irc org-protocol org-w3m org-mouse
46 org-notmuch icalendar)))
47
48 ;; And load org-mode
49 (require 'org)
50 ;; Without this the whole config can't load
51 (require 'ob-tangle)
52 ;; And finally, let org-babel do its work. All the rest of the emacs
53 ;; initialization comes from initjj.org
54 (org-babel-load-file (expand-file-name "initjj.org" (file-name-directory (or load-file-name (buffer-file-name))))))
55
56 ; And back done a bit with it, startup is over
57 (setq gc-cons-threshold 100000000)