diff --git a/emacs/.emacs.d/GNUmakefile b/emacs/.emacs.d/GNUmakefile index 92a11fe..604bb52 100644 --- a/emacs/.emacs.d/GNUmakefile +++ b/emacs/.emacs.d/GNUmakefile @@ -3,7 +3,7 @@ EMACS := emacs .SECONDARY: -AUTOLOADS_FILE := site-lisp/site-autoloads.el +AUTOLOADS_FILE := site-lisp/oni-site-autoloads.el UNWANTED := $(AUTOLOADS_FILE) site-lisp/flycheck_% site-lisp/flycheck-% SITE_LISPS := $(filter-out $(UNWANTED),$(wildcard site-lisp/*.el)) COMPILED_SITE_LISPS := $(addsuffix c,$(SITE_LISPS)) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 445e2f7..0c4cc7f 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -25,27 +25,23 @@ ;;; Code: +;;;; Load path and autoloads + (eval-and-compile (let ((load-directory (file-name-directory (or load-file-name byte-compile-current-file)))) (add-to-list 'load-path (format "%sinit/" load-directory)) - - (mapc (lambda (d) (add-to-list 'load-path d)) - (directory-files - (format "%svendor-lisp/" load-directory) t "^[^.]")) - (add-to-list 'load-path (format "%ssite-lisp/" load-directory)) (add-to-list 'load-path (format "%sos-lisp/" load-directory)) - (let ((loaddefs (format "%ssite-lisp/site-autoloads.el" load-directory))) - (when (file-exists-p loaddefs) - (load loaddefs))) + (mapc (lambda (d) (add-to-list 'load-path d)) + (directory-files + (format "%svendor-lisp/" load-directory) t "^[^.]")))) - (if (eq system-type 'windows-nt) - (require 'oni-windows-nt)))) +(load "oni-site-autoloads" :noerror :nomessage) -(require 'oni-helpers) +;;;; Package (require 'package) @@ -57,21 +53,22 @@ (eval-and-compile (package-initialize)) -(eval-when-compile - (let* ((not-installed (seq-remove 'package-installed-p - package-selected-packages)) - (available (seq-filter (lambda (p) - (assq p package-archive-contents)) - not-installed)) - (difference (- (length not-installed) (length available)))) - (when (> difference 0) - (silently "Refresh packages" - (package-refresh-contents))) - (when available - (mapc (lambda (p) (package-install p t)) available)))) - (add-hook 'package-menu-mode-hook 'hl-line-mode) +;;;; Dependencies + +(require 'counsel) +(require 'destroy-trailing-whitespace) +(require 'diff-hl) +(require 'diminish) +(require 'ivy) +(require 'ivy-hydra) +(require 'oni-helpers) +(require 'projectile) +(require 'shackle) + +;;;; Settings + (setq backup-directory-alist `((".*" . ,(oni:data-location "backup-files/")))) @@ -95,7 +92,6 @@ (global-set-key (kbd "C-x f") 'ffap) (global-set-key (kbd "C-x C-b") 'ibuffer) -(require 'destroy-trailing-whitespace) (global-destroy-trailing-whitespace-mode) (setq require-final-newline t) @@ -133,17 +129,10 @@ (concat user-emacs-directory "vendor-lisp/yoshi-theme")) (load-theme 'yoshi :no-confirm) -(require 'diminish) - -(require 'ivy) -(require 'ivy-hydra) - (diminish 'ivy-mode) (ivy-mode) -(require 'counsel) - (setq counsel-find-file-ignore-regexp (rx (or (and bos ".") (and ".zwc" eos)))) @@ -165,7 +154,6 @@ (add-hook 'minibuffer-setup-hook 'electric-pair-local-mode) -(require 'shackle) (shackle-mode) (with-eval-after-load 'shr (load "oni-shr-init")) @@ -197,7 +185,6 @@ ;; (propertize (concat " " (char-to-string #xf149)) ;; 'face '(:family "Font Awesome" :height 0.75))) -(require 'diff-hl) (global-diff-hl-mode) (blink-cursor-mode -1) @@ -219,8 +206,6 @@ ORIG-FUN is the function being wrapped, ARGS are the arguments specified" (setq projectile-known-projects-file (oni:data-location "projectile-bookmarks.eld")) -(require 'projectile) - (with-eval-after-load 'projectile (setq projectile-mode-line '(:eval @@ -365,6 +350,9 @@ ORIG-FUN is the function being wrapped, ARGS are the arguments specified" (add-to-list 'grep-files-aliases '("css" . "*.css *.less *.sass *.scss")) (add-to-list 'grep-files-aliases '("php" . "*.php *.inc *.module")) +(if (eq system-type 'windows-nt) + (require 'oni-windows-nt)) + (setq custom-file (concat user-emacs-directory "custom.el")) (load custom-file t)