Update init.el and add init-load-path.el

This commit is contained in:
Henrik Lissner 2015-06-14 17:16:02 +02:00
parent c2936b2056
commit 82fccda2f6
2 changed files with 47 additions and 5 deletions

40
init-load-path.el Normal file
View file

@ -0,0 +1,40 @@
;;; init-load-path.el
(fset '! 'eval-when-compile)
(defconst narf-emacs-dir user-emacs-directory)
(defconst narf-core-dir (! (concat narf-emacs-dir "core/")))
(defconst narf-modules-dir (! (concat narf-emacs-dir "modules/")))
(defconst narf-contrib-dir (! (concat narf-emacs-dir "contrib/")))
(defconst narf-private-dir (! (concat narf-emacs-dir "private/")))
(defconst narf-elpa-dir (! (concat narf-emacs-dir ".cask/" emacs-version "/elpa/")))
(defconst narf-temp-dir (! (concat narf-private-dir "cache/" (system-name) "/")))
(defconst narf-snippet-dirs (! (list (concat narf-private-dir "snippets/")
(concat narf-private-dir "templates/"))))
(! (defun --subdirs (path)
(let ((result '())
(paths (ignore-errors (directory-files path t "^[^.]" t))))
(dolist (file paths)
(when (file-directory-p file)
(add-to-list 'result file)))
result)))
;; Scan various folders to populate the load-dirs
(setq custom-theme-load-path
(! (append (--subdirs (concat narf-private-dir "themes/"))
custom-theme-load-path)))
(setq load-path
(! (require 'cask)
(cask-initialize)
(setq load-path (append (list narf-core-dir narf-contrib-dir narf-modules-dir narf-private-dir)
(list (concat narf-core-dir "lib"))
(list (concat narf-modules-dir "lib"))
(--subdirs narf-contrib-dir)
load-path))))
(defconst IS-MAC (eq system-type 'darwin))
(defconst IS-LINUX (eq system-type 'gnu/linux))
(defconst IS-WINDOWS (eq system-type 'windows-nt))
;;; init-load-path.el ends here

12
init.el
View file

@ -2,9 +2,9 @@
;; ;;
;; Author: Henrik Lissner <henrik@lissner.net> ;; Author: Henrik Lissner <henrik@lissner.net>
;; URL: https://github.com/hlissner/emacs.d ;; URL: https://github.com/hlissner/emacs.d
;; Version: 0.0.0001 ;; Version: 0.1.0
;; ;;
;;; Are you pondering what i'm pondering, Pinky? ;;; Are you pondering what I'm pondering, Pinky?
;; ;;
;; ,,, !/:. ;; ,,, !/:.
;; /::\". !!::: ;; /::\". !!:::
@ -42,11 +42,11 @@
(defconst narf-debug-mode nil) (defconst narf-debug-mode nil)
(defconst narf-default-font '(:family "terminus (ttf)" :size 12 :antialias nil))
(defconst narf-default-theme (if window-system 'narf-dark 'wombat)) (defconst narf-default-theme (if window-system 'narf-dark 'wombat))
(defconst narf-default-font '(:family "terminus (ttf)" :size 12 :antialias nil))
(defconst narf-big-font '(:family "Inconsolata" :size 18 :antialias t))
(setq user-emacs-directory "~/Dropbox/Projects/dev/narf-emacs/") (load (concat user-emacs-directory "init-load-path.el"))
(load (concat user-emacs-directory "core/core.el"))
(mapc 'require (mapc 'require
'()) '())
;; (;; Settings for specific modes or tools ;; (;; Settings for specific modes or tools
@ -83,5 +83,7 @@
(require 'local nil t) (require 'local nil t)
(message ">>> Loaded in %s" (emacs-init-time)) (message ">>> Loaded in %s" (emacs-init-time))
(defun display-startup-echo-area-message ()
(message ">>> Loaded in %s" (emacs-init-time)))
;;; I think so Brain... ;;; I think so Brain...