fix: overriding doom-version's plist

setplist will overwrite a symbol's previous properties (like
documentation).
This commit is contained in:
Henrik Lissner 2022-09-24 19:41:04 +02:00
parent 71b2b09f5c
commit 5d2313155c
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -362,23 +362,24 @@ Defaults to the profile at `doom-profile-default'."
(signal 'doom-autoload-error (list init-file e)))))) (signal 'doom-autoload-error (list init-file e))))))
(defun doom-profile--generate-init-vars () (defun doom-profile--generate-init-vars ()
(let ((v (version-to-list doom-version)) ;; FIX: Make sure this only runs at startup to protect us Emacs' interpreter
(ref (doom-call-process "git" "-C" (doom-path doom-emacs-dir) "rev-parse" "HEAD")) ;; re-evaluating this file when lazy-loading dynamic docstrings from the
(branch (doom-call-process "git" "-C" (doom-path doom-emacs-dir) "branch" "--show-current"))) ;; byte-compiled init file.
;; FIX: Make sure this only runs at startup to protect us Emacs' interpreter `((when (doom-context-p 'init)
;; re-evaluating this file when lazy-loading dynamic docstrings from the ,@(cl-loop for var in doom-autoloads-cached-vars
;; byte-compiled init file. if (boundp var)
`((when (doom-context-p 'init) collect `(set-default ',var ',(symbol-value var)))
,@(cl-loop for var in doom-autoloads-cached-vars ,@(cl-loop with v = (version-to-list doom-version)
if (boundp var) with ref = (doom-call-process "git" "-C" (doom-path doom-emacs-dir) "rev-parse" "HEAD")
collect `(set-default ',var ',(symbol-value var))) with branch = (doom-call-process "git" "-C" (doom-path doom-emacs-dir) "branch" "--show-current")
(setplist 'doom-version for (var . val)
'(major ,(nth 0 v) in `((major . ,(nth 0 v))
minor ,(nth 1 v) (minor . ,(nth 1 v))
build ,(nth 2 v) (build . ,(nth 2 v))
tag ,(ignore-errors (cadr (split-string doom-version "-" t))) (tag . ,(ignore-errors (cadr (split-string doom-version "-" t))))
ref ,(if (zerop (car ref)) (cdr ref)) (ref . ,(if (zerop (car ref)) (cdr ref)))
branch ,(if (zerop (car branch)) (cdr branch)))))))) (branch . ,(if (zerop (car branch)) (cdr branch))))
collect `(put 'doom-version ',var ',val)))))
(defun doom-profile--generate-load-modules () (defun doom-profile--generate-load-modules ()
(let* ((init-modules-list (doom-module-list nil t)) (let* ((init-modules-list (doom-module-list nil t))