Allow for local emacs config

This commit is contained in:
peter.selby@bytedance.com 2023-11-10 09:37:04 -08:00
parent 20f13d80e2
commit ff5d125f66
1 changed files with 13 additions and 0 deletions

View File

@ -159,6 +159,19 @@
(load full-file))
(message "Skipping invalid file %s" full-file))))))
(let ((local-dir (if (getenv "DOOM_EMACS_LOCAL_PATH")
(getenv "DOOM_EMACS_LOCAL_PATH")
(expand-file-name ".local/emacs" (getenv "HOME")))))
(let ((configs (filter (lambda (name) (not (or (string-match "~$" name)
(string-match "^[.]" name)))
(directory-files local-dir)))))
(dolist (config configs)
(let ((full-file (expand-file-name file site-dir)))
(if (or (file-regular-p full-file) (file-symlink-p full-file))
(progn (message "Loading file %s" full-file)
(load full-file))
(message "Skipping invalid file %s" full-file))))))
(provide 'config)
;;; config.el ends here