Personal emacs config
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.1 KiB

7 years ago
7 years ago
7 years ago
  1. (setq custom-file "~/.emacs.d/custom.el")
  2. (load custom-file 'noerror)
  3. (require 'package)
  4. (add-to-list 'package-archives
  5. '("melpa" . "https://melpa.org/packages/") t)
  6. (package-initialize)
  7. (when (not package-archive-contents)
  8. (package-refresh-contents))
  9. (mapc #'(lambda (package)
  10. (unless (package-installed-p package)
  11. (package-install package)))
  12. package-selected-packages)
  13. (defvar org-init/settings.org-message-depth 4
  14. "What depth of settings.org headers to message at startup.")
  15. ;;; init.el
  16. (with-temp-buffer
  17. (insert-file "~/.emacs.d/settings.org")
  18. (goto-char (point-min))
  19. (while (not (eobp))
  20. (forward-line 1)
  21. (cond
  22. ;; Report Headers
  23. ((looking-at
  24. (format "\\*\\{2,%s\\} +.*$"
  25. org-init/settings.org-message-depth))
  26. (message "%s" (match-string 0)))
  27. ;; Evaluate Code Blocks
  28. ((looking-at "^#\\+BEGIN_SRC +emacs-lisp *$")
  29. (let ((l (match-end 0)))
  30. (search-forward "\n#+END_SRC")
  31. (eval-region l (match-beginning 0))))
  32. ;; Finish on the next level-1 header
  33. ((looking-at "^\\* ")
  34. (goto-char (point-max))))))