forked from technomancy/emacs-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 2
/
init.el
100 lines (81 loc) · 3.35 KB
/
init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
;;; init.el --- Where all the magic begins
;;
;; Part of the Emacs Starter Kit
;;
;; This is the first thing to get loaded.
;;
;; "Emacs outshines all other editing software in approximately the
;; same way that the noonday sun does the stars. It is not just bigger
;; and brighter; it simply makes everything else vanish."
;; -Neal Stephenson, "In the Beginning was the Command Line"
;; Turn off mouse interface early in startup to avoid momentary display
;; You really don't need these; trust me.
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
;; Load path etc.
(setq dotfiles-dir (file-name-directory
(or (buffer-file-name) load-file-name)))
;; Load up ELPA, the package manager
(add-to-list 'load-path dotfiles-dir)
(add-to-list 'load-path (concat dotfiles-dir "/esk"))
(add-to-list 'load-path (concat dotfiles-dir "/vendor"))
(setq autoload-file (concat dotfiles-dir "loaddefs.el"))
(setq package-user-dir (concat dotfiles-dir "elpa"))
(setq custom-file (concat dotfiles-dir "custom.el"))
(setq byte-compile-warnings '(cl-functions))
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(require 'starter-kit-elpa)
;; These should be loaded on startup rather than autoloaded on demand
;; since they are likely to be used in every session
(require 'cl)
(require 'saveplace)
(require 'ffap)
(require 'uniquify)
(require 'ansi-color)
(require 'recentf)
(require 'iedit)
(require 'longlines)
;; backport some functionality to Emacs 22 if needed
(require 'dominating-file)
;; Load up starter kit customizations
(require 'starter-kit-defuns)
(require 'starter-kit-bindings)
(require 'starter-kit-misc)
(require 'starter-kit-eshell)
(require 'starter-kit-lisp)
(require 'starter-kit-perl)
(require 'starter-kit-ruby)
(defun regen-autoloads (&optional force-regen)
"Regenerate the autoload definitions file if necessary and load it."
(interactive "P")
(let ((autoload-dir (concat dotfiles-dir "/vendor"))
(generated-autoload-file autoload-file))
(when (or force-regen
(not (file-exists-p autoload-file))
(some (lambda (f) (file-newer-than-file-p f autoload-file))
(directory-files autoload-dir t "\\.el$")))
(message "Updating autoloads...")
(let (emacs-lisp-mode-hook)
(update-directory-autoloads autoload-dir))))
(load autoload-file))
(regen-autoloads)
(load custom-file 'noerror)
;; You can keep system- or user-specific customizations here
(setq personal-dir (concat dotfiles-dir "personal")
system-specific-config (concat dotfiles-dir (system-name) ".el")
user-specific-config (concat dotfiles-dir user-login-name ".el")
user-specific-dir (concat dotfiles-dir user-login-name))
(add-to-list 'load-path personal-dir)
(add-to-list 'load-path user-specific-dir)
(mapc #'load (directory-files personal-dir nil ".*el$"))
(if (file-exists-p system-specific-config) (load system-specific-config))
(if (file-exists-p user-specific-dir)
(mapc #'load (directory-files user-specific-dir nil ".*el$")))
(if (file-exists-p user-specific-config) (load user-specific-config))
;; Disable warning about .emacs.d in load-path
(require 'warnings)
(add-to-list 'warning-suppress-log-types '(initialization))
;;; init.el ends here