amymacs

amymacs is a set of meta-packages for Emacs called 'modules' which can be individually installed.

Codeberg repository

1. Setup

  1. (Optional) Set up an amymacs alias

    Add the following line to your ~/.bashaliases or ~/.bashrc file to install amymacs.

    alias amymacs='emacs --init-directory ~/.amymacs.d'
    

    Launch amymacs from the command line and complete the following steps.

  1. Open this website on Emacs:

    M-x eww RET emacs.amypillow.net RET
    
  2. Add my archives and MELPA to your package archive list

    Place your cursor within the following progn installation script and use M-x eval-defun to evaluate it. This will save customization settings to the file given by the variable custom-file. I prefer to put this in a separate file from my init file, which you can do by evaluating the following expression and adding it to your init file.

    (setq custom-file (expand-file-name
                       "custom.el" user-emacs-directory))
    

    Otherwise, customized variables will be appended to your init file.

    Here is the installation script:

    (progn
      "Customize `package-archives' and save it for future sessions."
      (require 'package)
      (customize-save-variable
       'package-archives
       (cl-delete-duplicates
        `(("amymacs" . "https://emacs.amypillow.net/")
          ("amy" . "https://packages.amygrinn.com/")
          ,@package-archives
          ("melpa" . "https://melpa.org/packages/"))
        :test 'equal)
       "Added from https://emacs.amypillow.net")
      (package-refresh-contents)
      "Installed amymacs repository!")
    
  3. Install modules as packages

    All my modules are prefixed with 'my-'. Install them as you would any other package: via use-package statements, M-x list-packages, or any other way.

    To update a module, use the command M-x package-reinstall.

  4. Customize my-system

    My modules sometimes provide options to the my-system group. Customize all available options with M-x customize-group RET my-system.

2. Configuration

Use the following Emacs command to launch my config.org file, which can be tangled to configure common software configuration files, including for Emacs.

M-x browse-url-emacs RET https://emacs.amypillow.net/config.org RET

3. Modules

4. Discussion

4.1. Auto-requiring

A lot of my modules require themselves upon installation. This means there is no further setup needed, simply installing the module will apply the changes to Emacs. It also means that modules must be deleted entirely in order to be disabled, via M-x package-delete.

4.2. Version numbers

All of my modules' version numbers are set to 1 as described above. This signifies that there is only one valid and supported version available: the latest version of the file. It also signifies that every upgrade should be considered a breaking change.

Modules also won't be updated automatically via M-x list-packages or M-x package-upgrade-all. They must be manually reinstalled with M-x package-reinstall.

4.3. Why?

  1. Why modules?

    Modularizing my config allows me to install only what I need on different devices.

  2. Why packages?

    I decided to write my modules as packages for a few reasons, but most core to the decision is that Emacs package files naturally provide a skeleton for effective documentation and consistent organization.

    Packages also provide an easy way to handle dependency management, (native-)compilation, and a familiar interface through commands like M-x package-install-file or M-x package-install-from-buffer.

  3. Why package archive?

    From a user perspective, package archives are easier to set up than git repositories and available on more systems. It's also easier to upgrade from within Emacs and it allows modules to depend on other modules.