diff --git a/ci.el b/.doomrc similarity index 93% rename from ci.el rename to .doomrc index 72ba72e5d..65b48fdfc 100644 --- a/ci.el +++ b/.doomrc @@ -1,6 +1,7 @@ -;;; ci.el -*- lexical-binding: t; no-byte-compile: t; -*- +;;; .doomrc --- doom runtime config -*- mode: emacs-lisp; lexical-binding: t; -*- ;;; Commentary: ;;; Code: +(require 'doom) ; be silent, byte-compiler (after! doom-cli-ci ;;; Commit linter types @@ -50,4 +51,4 @@ :match "\\.org$" :map #'file-name-base))) -;;; ci.el ends here +;;; .doomrc ends here diff --git a/bin/doom b/bin/doom index cfe6334d8..2ecbbc5c3 100755 --- a/bin/doom +++ b/bin/doom @@ -198,8 +198,8 @@ SEE ALSO: silently fail on missing files, but --strict-load won't. Warning: files loaded this way load too late to define new commands. To - define commands, do so from `$DOOMDIR'/cli.el or `$DOOMDIR'/init.el - instead." + define commands, do so from `$DOOMDIR'/cli.el, `$DOOMDIR'/init.el, or a + .doomrc file in the current project tree." (when color? (setq doom-print-backend (if (eq color? :yes) 'ansi))) (when pager @@ -299,7 +299,17 @@ SEE ALSO: (load! cli-file path t))))) (doom-log "Loading $DOOMDIR/cli.el") - (load! cli-file doom-private-dir t)))) + (load! cli-file doom-private-dir t)) + + ;; Allow per-project Doom settings in .doom files. + (let (doomrc) + (cond + ((setq doomrc (getenv "DOOMRC")) + (load! doomrc)) + ((setq doomrc (locate-dominating-file default-directory ".doomrc")) + (load! ".doomrc" doomrc))) + (when doomrc + (print! "Loaded doomrc: %s" doomrc))))) ;; diff --git a/lisp/cli/ci.el b/lisp/cli/ci.el index ee5dd3137..b8d33d747 100644 --- a/lisp/cli/ci.el +++ b/lisp/cli/ci.el @@ -247,20 +247,6 @@ Note: warnings are not considered failures.") ;;; Commands ;;; doom ci -(defcli! (:before ci) (&args _) - (when-let* - ((repo-root - (if-let* ((result (sh! "git" "rev-parse" "--show-toplevel")) - ((zerop (car result)))) - (cdr result) - default-directory)) - (local-config - (car (or (doom-glob repo-root "ci.el") - (doom-glob doom-private-dir "ci.el"))))) - (defgroup! :prefix '(doom ci) - (load local-config nil t t)) - (print! (item "Loaded %S") local-config))) - (defcli! ci (&args _) "Commands that automate development processes." :partial t) diff --git a/lisp/doom-start.el b/lisp/doom-start.el index 2f3a5b229..e711dfd87 100644 --- a/lisp/doom-start.el +++ b/lisp/doom-start.el @@ -143,7 +143,8 @@ If RETURN-P, return the message as a string instead of displaying it." (float-time (time-subtract (current-time) before-init-time)))))) ;; Add support for additional file extensions. -(dolist (entry '(("/LICENSE\\'" . text-mode) +(dolist (entry '(("/\\.doomrc\\'" . emacs-lisp-mode) + ("/LICENSE\\'" . text-mode) ("\\.log\\'" . text-mode) ("rc\\'" . conf-mode) ("\\.\\(?:hex\\|nes\\)\\'" . hexl-mode)))