elisp/package-require.el
author Luke Hoersten <luke@hoersten.org>
Thu, 02 Oct 2025 10:54:52 -0500
changeset 112 c4c346aa93ab
parent 100 e1c2df47261d
permissions -rw-r--r--
Replaced flyspell mode with jinx. Changes: - Added jinx package - Replaced flyspell-mode with jinx-mode in text-mode and markdown-mode - Added enchant detection that shows a helpful warning in Warnings buffer if enchant is not installed, with OS-specific install instructions If enchant isn't installed when you start Emacs, you'll see a warning popup with instructions for your OS (brew for macOS, apt for Ubuntu).

;;; package-require --- Require that packages are installed
;;; Commentary:
;;; ~/.emacs.d/elisp/package-require.el
;;; Luke Hoersten <[email protected]>

(require 'package)

;;; Code:
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)

(package-initialize)
(package-refresh-contents)

(defun package-require (packages)
  "Ensure that a given PACKAGES are installed."
  (mapc (lambda (package)
          (unless (package-installed-p package)
            (package-install package)
            (message "Installing %s package...done" package)))
        packages))

(message "Loading packages...done")
(provide 'package-require)
;;; package-require.el ends here