;;; ... -*- lexical-binding: t -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Emacs customizations ;;; ;; Note to self: To compile el's: ;; M-x byte-compile-file RET ;; Give it the .el file ;; Added by Package.el. This must come before configurations of ;; installed packages. Don't delete this line. If you don't want it, ;; just comment it out by adding a semicolon to the start of the line. ;; You may delete these explanatory comments. (package-initialize) (message "Loading .emacs") ;; Set appropriate load-path (defun drkp:add-to-load-path-maybe (path msg append fatal) (if (not (file-accessible-directory-p path)) (if fatal (error msg) (message msg)) (add-to-list 'load-path path append))) (defun drkp:load-maybe (path msg fatal) (if (not (file-readable-p path)) (if fatal (error msg) (message msg)) (load path))) (drkp:add-to-load-path-maybe "~/dotfiles/elisp" "Failed to find elisp directory" nil t) (drkp:add-to-load-path-maybe "~/dotfiles/elisp/atc-elisp" "Failed to find atc-elisp directory" t nil) (drkp:add-to-load-path-maybe "~/dotfiles/elisp/extra" "Failed to find user-local packages" t nil) ;; XXX I wish there was a way to load the _latest_ version of these ;; override packages, since mine are sure to get out of date (drkp:add-to-load-path-maybe "~/dotfiles/elisp/extra-pre" "Failed to find user-local override packages" nil nil) ;; Possible local files (drkp:add-to-load-path-maybe "/opt/local/share/emacs/site-lisp" "Failed to find MacPorts site-lisp" nil nil) (drkp:load-maybe "/opt/local/share/emacs/site-lisp/common/cedet.el" "Failed to find MacPorts CEDET" nil) (drkp:add-to-load-path-maybe "~/.emacs.d/site-lisp" "Failed to find user-machine-local override packages" nil nil) (drkp:add-to-load-path-maybe "~/.emacs.d/jde/lisp" "Failed to find user-machine-local JDE packages" nil nil) (drkp:add-to-load-path-maybe "~/.emacs.d/org" "Failed to find user-machine-local org package" nil nil) ;; On PMG systems, /u is usually a symlink to /home, which we use to ;; refer to it in most cases. Add it to directory-abbrev-alist so that ;; emacs will refer to it by /u instead of /home -- but only if it's ;; actually a symlink to /home (if (equal (file-truename "/u") "/home") (setq directory-abbrev-alist (cons (cons "^/home" "/u") directory-abbrev-alist))) ;; Package management (require 'package) ;; Add MELPA (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) ;; Install use-package if needed; we'll use it to install the other packages (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (require 'use-package) ;; Always ensure packages are installed (setq use-package-always-ensure t) ;; Fix up path on OS X because OS X GUI launchers don't inherit $PATH ;; from the shell. (when (memq window-system '(mac ns x)) (use-package exec-path-from-shell :init (exec-path-from-shell-initialize))) ;; Load customization files (load "drkp-basic") (drkp:setup-user "Dan R. K. Ports" "dan@drkp.net") (drkp:basic-setup-all) (load "drkp-programming") (load "drkp-org") (load "drkp-ai") (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(mmm-default-submode-face ((((background dark)) (:background "DimGray")) (t (:background "LightGray")))))