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,9 +362,6 @@ 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))
(ref (doom-call-process "git" "-C" (doom-path doom-emacs-dir) "rev-parse" "HEAD"))
(branch (doom-call-process "git" "-C" (doom-path doom-emacs-dir) "branch" "--show-current")))
;; FIX: Make sure this only runs at startup to protect us Emacs' interpreter ;; FIX: Make sure this only runs at startup to protect us Emacs' interpreter
;; re-evaluating this file when lazy-loading dynamic docstrings from the ;; re-evaluating this file when lazy-loading dynamic docstrings from the
;; byte-compiled init file. ;; byte-compiled init file.
@ -372,13 +369,17 @@ Defaults to the profile at `doom-profile-default'."
,@(cl-loop for var in doom-autoloads-cached-vars ,@(cl-loop for var in doom-autoloads-cached-vars
if (boundp var) if (boundp var)
collect `(set-default ',var ',(symbol-value var))) collect `(set-default ',var ',(symbol-value var)))
(setplist 'doom-version ,@(cl-loop with v = (version-to-list doom-version)
'(major ,(nth 0 v) with ref = (doom-call-process "git" "-C" (doom-path doom-emacs-dir) "rev-parse" "HEAD")
minor ,(nth 1 v) with branch = (doom-call-process "git" "-C" (doom-path doom-emacs-dir) "branch" "--show-current")
build ,(nth 2 v) for (var . val)
tag ,(ignore-errors (cadr (split-string doom-version "-" t))) in `((major . ,(nth 0 v))
ref ,(if (zerop (car ref)) (cdr ref)) (minor . ,(nth 1 v))
branch ,(if (zerop (car branch)) (cdr branch)))))))) (build . ,(nth 2 v))
(tag . ,(ignore-errors (cadr (split-string doom-version "-" t))))
(ref . ,(if (zerop (car ref)) (cdr ref)))
(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))