Emacs Bankruptcy

3 freediver 1 9/11/2025, 10:26:11 PM irreal.org ↗

Comments (1)

phba · 2h ago
There is no law that says you must put everything into one file. You can divide your config into logical modules like editing, UI, settings for specific languages or modes etc. Put the Elisp code for each module into a separate file (package) and load them from your init.el. Additionally you can use feature flags or other checks to control whether a package gets loaded. This way you can easily revert changes to default, experiment without breaking things, or disable things you don't need at the moment but maybe again at another time.

init.el:

  (defgroup mystuff nil
    "A custom group for all my settings."
    :group 'mystuff)
  
  (defcustom mystuff/org t
    "Feature flag for my org-mode settings."
    :type '(choice (const :tag "Enabled" t)
                   (const :tag "Disabled" nil))
    :group 'mystuff)
  
  (when mystuff/org
    (require mystuff-org))
mystuff-org.el (somewhere in your load path):

  ;; Elisp code related to org-mode...
  
  (provide 'mystuff-org)
With M-x customize-group RET mystuff you can control which tweaks are active. Simple, flexible and maintainable.