emacs/init.el
Evie Litherland-Smith 74bbe0578f Guard against loading invalid config files
Ensure that config org-mode files don't contain "#" in the filename
when looping to call org-babel-load-file. These files only exist if a
file has unsaved changes, but directory-files will still find them as
.org files and attempt to load

Move package-archive definition and priorities into start of init.el,
since everything else actually depends on that (somewhat)
2024-04-05 15:22:48 +01:00

32 lines
977 B
EmacsLisp

;;; init -- My emacs config
;;; Commentary:
;; Moving my Emacs config from separate directory
;;; Code:
;; Stop popups for warning messages, keep in log buffer
(setopt warning-minimum-level :error)
;; Configure packages archives with priority
(when (require 'package nil :noerror)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/"))
(setopt package-archive-priorities '(("melpa" . 10)
("stable" . 5)
("nongnu" . 5)
("gnu" . 0)))
(package-initialize))
(defvar my/config-files
(directory-files (locate-user-emacs-file "config") t ".org")
"List of literate config files to load.")
(dolist (fname my/config-files)
(unless (string-match-p (regexp-quote "#") fname)
(org-babel-load-file fname)))
(provide 'init)
;;; init.el ends here