I've added a line in my early-init.el
file that sets a background color to prevent the glare during startup.
;; Customize background color to prevent startup glare
(add-to-list 'default-frame-alist
'(background-color . "#fff2f3"))
However, I've noticed that the code can also be written as:
;; Customize background color to prevent startup glare
(push '(background-color . "#fff2f3") default-frame-alist)
They both achieve the same result. I was wondering if there is any disadvantage in using one method over the other?
add-to-list
checks by default if the element to be added exists already in the list and, if so, it does not add it again.push
does not check. The doc string foradd-to-list
suggests that it is useful for config variables (likedefault-frame-alist
above) where the uniqueness might be important, but recommends thatpush
be used in Lisp code in general:C-h f add-to-list
.push
is usually faster in such cases. Fastest:(setq YOUR/LIST (cons NEW-ELT YOUR/LIST))
. Actually, the choice doesn't make much of a difference. Just choose one depending on your preference.*.el
, although it's little.