This script makes it easy to run Emacs with alternative configurations (i.e. not ~/.emacs.d). For example, to run Emacs with a configuration stored in ~/new-emacs.d, simply run:
$ with-emacs.sh --dir ~/new-emacs.dIt can also use temporary, “sandbox” directories that are automatically created and then removed after Emacs exits: just run with-emacs.sh without specifying a directory.
It’s helpful for developing packages, troubleshooting configuration problems, trying out alternative configurations, etc.
Copy with-emacs.sh into your PATH (or don’t, and run it from wherever you want).
with-emacs.sh [OPTIONS] [EMACS-ARGS]
Run Emacs with a specified configuration directory. If no directory
is specified, a temporary one is made with "mktemp -d" and removed
when Emacs exits.
Options
--debug Show debug information and don't remove temp directory.
-h, --help This.
-- Optionally used to separate script arguments from
Emacs arguments.
-d, --dir DIR Use DIR as user-emacs-directory.
-e, --emacs PATH Run Emacs executable at PATH.
-i, --install PACKAGE Install PACKAGE.
-O, --no-org-repo Don't use the orgmode.org ELPA repo.
-P, --no-package Don't initialize the package system.
-R, --no-refresh-packages Don't refresh package lists.
Fixes
- Remove obsolete
orgmode.orgELPA repo (which could cause obsolete versions of Org to be installed accidentally).
Changes
- Use
#!/usr/bin/env bash. (Thanks to Benoit Joly.)
Fixes
- Argument
-e/--emacs.
First tagged version. Renamed from emacs-sandbox.sh.
Inspired by and some code copied from MELPA’s Makefile.
- Chemacs2 is a system of three Elisp files designed to replace your
~/.emacs.dand switch between “profiles” stored in other directories. It requires a configuration file pointing to the profiles’ directories. It offers some additional functionality, like setting environment variables per-profile.- In contrast,
with-emacs.shdoes not replace anything, and it requires no configuration; just run it with a directory of your choice. It’s just a Bash script, so if you want to set an environment variable, use standard tools, likeenv.
- In contrast,
Bug reports, feature requests, suggestions — oh my!
GPLv3