Subject: bug#38843: define-globalized-minor-mode enable boolean will prevent loading with :require

From: "Paul W. Rankin" <[email-masked]>
Date: Wed, 01 Jan 2020 17:10:19 +1000

When defining a global minor mode with define-globalized-minor-mode, an
automatic custom option is created to enable that minor mode. If the
user wishes to enable this global minor mode at startup, he/she toggles
this boolean to "on" and saves his/her init. This should enable the
global minor mode upon startup (if available).

If a global minor modes is based on local minor modes, it may use a
:require keyword in the global minor mode definition, e.g. from
page-break-lines:

    ;;;###autoload
    (define-global-minor-mode global-page-break-lines-mode
      page-break-lines-mode page-break-lines-mode-maybe
      :require 'page-break-lines
      :group 'page-break-lines)

Toggling the option global-page-break-lines-mode in this case will add
the following to the user's init:

    '(global-page-break-lines-mode t nil (page-break-lines))

The problem occurs when page-break-lines is for whatever reason
unavailable, it will prevent Emacs from loading.

The customize system is designed not to prevent loading even when
libraries are unavailable, e.g.settings remain after uninstalling the
associated program/library because it makes sense if the user chooses to
reinstall. That is, the presence of settings pertaining to unavailable
programs/libraries should not prevent Emacs from loading.

So, what is the solution here? This feels to me like a bug with the way
define-globalized-minor-mode saves this boolean...