Goal
I wish to further extend modularity of my spacemacs
configuration by referencing files user-config.org
and user-layers.org
Template
I have achieved the former by adding the following to my dotspacemacs/user-config:
(defun dotspacemacs/user-config ()
(org-babel-load-file (expand-file-name
"user-config.org" dotspacemacs-directory)))
I can safely experiment with, clone-sync, org
anize, version-control user-config.org
Problem
Now, dotspacemacs/user-layers is a variable (default-)set in a function in the following manner:
(defun dotspacemacs/layers ()
(setq-default
dotspacemacs-distribution 'spacemacs ;; not relevant
;;
;; many such default variable-value lines in between, skipped.
;;
dotspacemacs-configuration-layers
'(
;;
;; many layers auto-added/managed by spacemacs
;;
git
(python :variables python-backend 'lsp
python-lsp-server 'pyright
;; other such python configurations
python-formatter 'yapf))
;; other such default varialbe-value declarations
)
)
Attempt
I tried adding a similar inheretance (as with user-config
) at the end of the setq-default
in the following manner,
- N.B.
dotspacemacs-configuration-layers
cannot be modified outside the functiondotspacemacs/layers
, hence, reference to the file has to be called within that function.
(defun dotspacemacs/layers ()
(setq-default
dotspacemacs-distribution 'spacemacs
;;
;; many such default variable-value lines in between, skipped.
;;
dotspacemacs-configuration-layers
'(
;; whatever spacemacs wants to auto-add
)
;; other such default variable-value declarations
)
(org-babel-load-file (expand-file-name
"user-layers.org" dotspacemacs-directory))
)
—such that user-layers.org
is of the following form:
Referenced org-mode
file:
- dotspacemacs layers
#+BEGIN_SRC emacs-lisp
(append dotspacemacs-configuration-layers
'(
;;
;; Other layers managed by the user
;;
git
(python :variables python-backend 'lsp
python-lsp-server 'pyright
;; other such python configurations
python-formatter 'yapf)))
#+END_SRC
Failure
However, append
does not appear to add elements to the seq-default
value.
I guess it is appending to the variable's local setq
value.
(I may be wrong at this, as lisp isn't my motherbored tongue, python is.)
Question:
Is there a way to extend the default value of a list in emacs-lisp by adding elements from another list?
clarification:
—such that after addition, the default value of the list contains the newly added elements.