Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
21.0: ;; We avoid this cache, because various frame and device
21.0: ;; properties can change.
21.0: ;;(default-custom-frame-properties)
This comment represents a misunderstanding of the code in question.
`default-custom-frame-properties' is not a cache, it is -- as the name
says -- a default. Frames which have properties different from the
default will get frame local faces. Other frames will simply use the
global faces, which will be initialized according to the default
properties.
This works work even if the default doesn't match any existing frame.
It will be less optimal, since all frames will then have frame local
faces, but it will work. The only requirement for
`default-custom-frame-properties' to work is that the value remains
static. By commenting out the line in question, the value become
dynamic, and thus can no longer work.
Regarding the comment: The only relevant frame propety which _can_
change is `background-mode'. If that happens, the only remedy is to
clear the `custom-properties' frame property (which _is_ a cache) and
call `custom-initialize-frame' again.
You could remove the `custom-properties' cache, but that would slow
down both frame and face creation, and you would _still_ have to call
`custom-initialize-frame' manually. It would be better to create a
`reset-frame-faces' command that does both, if changing the background
mode is something you do often.