dev: replace .doomrc w/ .doom.el

Also replaces the project's .doomrc file with a .doom (which isn't used
or recognized just yet, but will be later).
This commit is contained in:
Henrik Lissner
2025-06-30 12:34:53 +02:00
parent fdc0fa3bec
commit 1adc318cac
4 changed files with 102 additions and 60 deletions

98
.doom Normal file
View File

@ -0,0 +1,98 @@
"3.0.0-pre"
((name . doom)
(version . "3.0.0-pre")
(homepage . "https://doomemacs.org")
(commit
(preset doom-conventional-commits)
(types "module")
(scopes "cli" "lib"
(module)
(release "modules")
(docs
"install"
(lambda (scope _plist)
"Allow any filename in docs/* as a scope for docs commits."
(member
scope (doom-files-in (doom-path (dir!) "../docs")
:match "\\.org$"
:map #'file-name-base))))
(lambda (scope _plist)
"Only allow :CATEGORY or MODULE scopes if they actually exist."
(doom-glob
(dir!) "modules" (if (string-prefix-p ":" scope)
(format "%s" (substring scope 1))
(format "*/%s" scope))))))
(make
(".github/CODEOWNERS"
"# Auto-generated by 'doom make .github/CODEOWNERS', do not edit it by hand.")
"*\t@doomemacs/maintainers" ; default until another takes precedence
,@(cl-sort
(cl-loop for path in (doom-module-load-path (list doom-modules-dir))
if (string-match "/modules/\\([^/]+\\)/\\([^/]+\\)$" path)
collect (format "%s\t@doomemacs/%s-%s"
(substring (match-string 0 path) 1)
(match-string 1 path)
(match-string 2 path)))
#'string-lessp)))
(publish
(targets "docs/index.org" "docs" "modules/*/README.org")
(env
(global-menus
("± Suggest edits" . "doom-suggest-edit:")
("? Help"
. ,(lambda! (&key title)
(cond ((equal title "Changelog") "doom-help-changelog:")
((string-prefix-p ":" title) "doom-help-modules:")
("doom-help:")))))
(menus
(("docs/*.org" "modules/README.org")
(left ("← Back to index" . "doom-index:")))
("docs/index.org"
(left ("↖ FAQ" . "doom-faq:")))
("modules/*/README.org"
(left ("← Back to module index" . "doom-module-index:")))
("modules/*/*/README.org"
(left ("← Back to module index" . "doom-module-index:"))
(right ("↖ History"
. ,(lambda! (&key category module)
(format "doom-module-history:%s/%s" (doom-keyword-name category) module)))
("! Issues"
. ,(lambda! (&key category module)
(format "doom-module-issues::%s %s" category module))))))))
(sources
(doom
(title . "Doom Core Modules")
(version . "25.01.0-pre")
(paths "lisp/" "lisp/modules/*/"))
(doom+
(title . "Doom Official Modules")
(version . "25.01.0-pre")
(paths "modules/*/" "modules/*/*/"))
(doom++
(title . "Doom Community Modules")
(version . "25.01.0-pre")
(paths "modules/*/" "modules/*/*/")))
(profiles
(test
(sources doom)
(modules :doom (cli +ci +buttercup))
(packages)))
(packages
(straight :host github
:repo "radian-software/straight.el"
:branch "develop"
:local-repo "straight.el"
:files ("straight*.el")
:pin "33fb4695066781c634ff1c3c81ba96e880deccf7")
;; (elpaca :repo "https://github.com/progfolio/elpaca.git"
;; :pin "34b1d1b19d24470758b62ab1d10ed70068186c12"
;; :depth 1
;; :files (:defaults "elpaca-test.el" (:exclude "extensions"))
;; :build (:not elpaca--activate-package))
))

55
.doomrc
View File

@ -1,55 +0,0 @@
;;; .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
(add-to-list 'doom-ci-commit-types 'module)
(add-to-list 'doom-ci-commit-scopeless-types 'module)
;;; Commit linter scopes
(add-to-list 'doom-ci-commit-scopes "cli")
(add-to-list 'doom-ci-commit-scopes "lib")
(add-to-list 'doom-ci-commit-scopes "docs")
(add-to-list 'doom-ci-commit-scopes '(docs "install" ci-check-docs-scope))
(add-to-list 'doom-ci-commit-scopes #'ci-check-module-scope)
;; DEPRECATED Will be removed once modules live in their own repo
(add-to-list 'doom-ci-commit-scopes '(release "modules")))
(after! doom-cli-make
;;; Codeowners
;; I will be the default owner for everything in the repo unless a later match
;; takes precedence.
(add-to-list 'doom-make-codeowners "# The default owner(s) unless another takes precedence")
(add-to-list 'doom-make-codeowners '("*" . "@doomemacs/maintainers"))
;; Module maintainers (see https://git.doomemacs.org/teams)
(add-to-list 'doom-make-codeowners "# Module maintainers")
(save-match-data
(setq doom-make-codeowners
(nreverse
(append doom-make-codeowners
(cl-sort
(cl-loop for path in (doom-module-load-path (list doom-modules-dir))
if (string-match "/modules/\\([^/]+\\)/\\([^/]+\\)$" path)
collect (cons (substring (match-string 0 path) 1)
(format "@doomemacs/%s-%s"
(match-string 1 path)
(match-string 2 path))))
#'string-lessp :key #'car))))))
;;; Helpers
(defun ci-check-module-scope (scope _plist)
"Only allow :CATEGORY or MODULE scopes if they actually exist."
(doom-glob (dir!) "modules" (if (string-prefix-p ":" scope)
(format "%s" (substring scope 1))
(format "*/%s" scope))))
(defun ci-check-docs-scope (scope _plist)
"Allow any filename in docs/* as a scope for docs commits."
(member
scope (doom-files-in (doom-path (dir!) "../docs")
:match "\\.org$"
:map #'file-name-base)))
;;; .doomrc ends here

View File

@ -298,13 +298,13 @@ SEE ALSO:
(defcli-group! :prefix (if (cdr key) (format "+%s" (cdr key))) (defcli-group! :prefix (if (cdr key) (format "+%s" (cdr key)))
(doom-load (file-name-sans-extension path)))))))) (doom-load (file-name-sans-extension path))))))))
;; Allow per-project Doom settings in .doom files. ;; Execute arbitrary CLI configuration in a local .doom.el file
(let (doomrc) (let (doomrc)
(cond (cond
((setq doomrc (getenv "DOOMRC")) ((setq doomrc (getenv "DOOMRC"))
(load! doomrc default-directory)) (load! doomrc default-directory))
((setq doomrc (locate-dominating-file default-directory ".doomrc")) ((setq doomrc (locate-dominating-file default-directory ".doom.el"))
(load! ".doomrc" doomrc))))) (load! ".doom.el" doomrc)))))
;; ;;

View File

@ -18,7 +18,6 @@
(add-to-list 'safe-local-variable-directories doom-user-dir) (add-to-list 'safe-local-variable-directories doom-user-dir)
;;; Support for Doom-specific file extensions ;;; Support for Doom-specific file extensions
(add-to-list 'auto-mode-alist '("/\\.doom\\(?:project\\|module\\|profile\\)?\\'" . lisp-data-mode)) (add-to-list 'auto-mode-alist '("/\\.doom\\(?:module\\|profile\\)?\\'" . lisp-data-mode))
(add-to-list 'auto-mode-alist '("/\\.doomrc\\'" . emacs-lisp-mode))
;;; init.el ends here ;;; init.el ends here