forked from jimweirich/emacs-setup
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot.emacs
59 lines (50 loc) · 2.22 KB
/
dot.emacs
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
;;; GNU-Emacs Initialization File
;;; based off of Jim Weirich's initialization file
;; Some file locations are relative to the HOME or the BIN directory
(defvar home-dir)
(setq home-dir (concat (expand-file-name "~") "/"))
(defvar bin-dir (concat home-dir "bin/"))
;; load any customizations for the current machine
(setq dot-emacs-dot-d (concat home-dir ".emacs.d/"))
(when (file-exists-p dot-emacs-dot-d)
;;(add-to-load-path dot-emacs-dot-d)
(let ((local-el (concat dot-emacs-dot-d "local.el")))
(when (file-readable-p local-el)
(load local-el))))
;; (defvar elisp-root (concat
;; (file-name-directory
;; (or (buffer-file-name) load-file-name))
;; "../")
;; "Directory containing the Emacs initialization.")
(defvar elisp-root
(file-name-directory
(or (buffer-file-name) load-file-name))
"Directory containing the Emacs initialization.")
(setq elisp-directory (concat home-dir ".elisp/"))
(load (concat elisp-directory "load-ini.el"))
;; Keep custom variables, (M-x customize*), in their own file
;; http://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Customizations.html
(cond ((< emacs-major-version 21)
;; Emacs 20 customization
(setq custom-file (concat elisp-directory "emacs-custom-20.el")))
((and (= emacs-major-version 21) (< emacs-minor-version 4))
;; Emacs 21 customization, before version 21.4
(setq custom-file (concat elisp-directory "emacs-custom-21.el")))
((< emacs-major-version 22)
;; Emacs 21 customization, before version 21.4
(setq custom-file (concat elisp-directory "emacs-custom-21.4.el")))
(t
;; Emacs version 22.1 or later
(setq custom-file (concat elisp-directory "emacs-custom-22.el"))))
;; load the stored settings
(when (file-readable-p custom-file)
(load custom-file 'noerror))
;;; This was installed by package-install.el.
;;; This provides support for the package system and
;;; interfacing with ELPA, the package archive.
;;; Move this code earlier if you want to reference
;;; packages in your .emacs.
(let ((fn (expand-file-name "~/.emacs.d/elpa/package.el")))
(when (file-readable-p fn)
(load fn)
(package-initialize)))