If you want to change the appearance of face mode-line
for your personal use, and for future Emacs sessions, then use Customize - in this case, customize-face
.
If you want to change its appearance only for the current Emacs session, use either one.
If you want to change the appearance using Elisp, e.g., in a library, then use set-face-attribute
.
There's nothing special about changing faces in this question, as posed. And nothing special about face mode-line
. This is really just the question about when to use Customize versus Elisp.
There's also a question about whether to use Elisp in your init file or use Customize, putting the setting in your custom-file
. Different people prefer the one or the other. Generally, IMO, you should leverage Customize - that's what it's for, whether you use its functions in Lisp code or you use the Customize UI. And it's a good idea to confine Customize to a custom-file
, not let it write to your init file.
This is all covered in other Q&A on this site and elsewhere... Just search tags [customize]
etc.
For example, this covers the general Lisp-vs-Customize question for user options. The same applies to faces.