Subject: bug#78637: 30.1.90; Calling setopt during init loads cus-start over and over

From: Stefan Monnier <[email-masked]>
Date: Sat, 31 May 2025 11:17:04 -0400

> While trying to improve Emacs startup time at my site, I noticed that
> cus-start was being loaded repeatedly, each time setopt was called.

I don't see this, but I do see `cus-start` being (re)loaded when the
first `setopt` is executed.

This comes from the weird conditional below:

    (unless dump-mode
      (provide 'cus-start))

This dates back to

    commit 4883633e7b4416a0da1a63bc7fd0c4081bdc7837
    Author: Richard M. Stallman <[email-masked]>
    Date:   Sat May 31 00:54:10 1997 +0000
    
        Arrange to load it once during dumping,
        and again if needed by cus-edit.el.
        (custom-start-quote): Don't define as separate function.
        (load-path): Improve the :type.
        (delete-exited-processes): Fix group to processes-basics.

I have no idea why, but it's not a new problem.

Maybe the repeated-loading you're seeing is due to `dump-mode` being
non-nil in your Emacs build?  If that's the case, do you have any idea
why that would be the case (it's rather unusual).

        Stefan