Clean up init files
This commit is contained in:
parent
f63d831575
commit
accd943e87
2 changed files with 90 additions and 83 deletions
|
@ -1,41 +1,50 @@
|
|||
;;; init-load-path.el
|
||||
|
||||
(fset '! 'eval-when-compile)
|
||||
(setq gc-cons-threshold 84857600)
|
||||
|
||||
(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-script-dir (concat narf-emacs-dir "scripts/"))
|
||||
(defconst narf-snippet-dirs (list (concat narf-private-dir "snippets/")
|
||||
(concat narf-private-dir "templates/")))
|
||||
(eval-and-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-script-dir (concat narf-emacs-dir "scripts/"))
|
||||
(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)))
|
||||
(eval-when-compile
|
||||
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/cask")
|
||||
(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)))
|
||||
(eval-when-compile
|
||||
(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))))
|
||||
(eval-when-compile
|
||||
(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))
|
||||
|
||||
(when (file-exists-p "~/.emacs.local.el")
|
||||
(load "~/.emacs.local.el"))
|
||||
|
||||
;;; init-load-path.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue