conf-init.el 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. (provide 'conf-init)
  2. ; -------- Preamble ---------
  3. (setq emacs-dir "~/.emacs.d/")
  4. (defun in-emacs-d (path)
  5. (concat emacs-dir path))
  6. (setq mode-dir (in-emacs-d "modes/"))
  7. (defun in-modes-d (path)
  8. (concat mode-dir path))
  9. (setq custom-dir (in-emacs-d "custom/"))
  10. (defun in-custom-d (path)
  11. (concat custom-dir path))
  12. (add-to-list 'load-path emacs-dir)
  13. (add-to-list 'load-path mode-dir)
  14. (add-to-list 'load-path custom-dir)
  15. (defun require-from-modes-d (path &optional symbol)
  16. (add-to-list 'load-path (in-modes-d path))
  17. (if symbol
  18. (require symbol)
  19. (load-library path))
  20. )
  21. (if (< emacs-major-version 24)
  22. (add-to-list 'load-path (in-emacs-d "compat23")))
  23. (require 'elisp-utils)
  24. (require 'setup-package)
  25. (if (getenv "http_proxy")
  26. (eval-after-load "url"
  27. '(progn
  28. (setq url-using-proxy(getenv "http_proxy")))))
  29. ;; (setq parts-dir (in-emacs-d "parts"))
  30. ;; (defun load-part (part-name)
  31. ;; (load-file (concat parts-dir "/" part-name))
  32. ;; )
  33. ;; (defun load-part-if-not-hidden (part-name)
  34. ;; (if (not (elisp-utils/starts-with part-name "."))
  35. ;; (load-part part-name)))
  36. (defun autoload-and-run (symbol file interactive callback)
  37. (autoload symbol file nil interactive)
  38. (eval-after-load (symbol-name symbol) callback)
  39. )
  40. ; actually load all parts in order
  41. ;;(add-hook 'after-init-hook (lambda ()
  42. ;; (mapcar 'load-part-if-not-hidden (sort (directory-files parts-dir) 'string<))
  43. ;; ; ------------------ Custom site-specific settings ------------------
  44. ;; (setq site-specific-filename (expand-file-name "~/.emacs-site.el"))
  45. ;; (if (file-exists-p site-specific-filename)
  46. ;; (load site-specific-filename)
  47. ;; )))