You can watch the demo for this video here: https://youtu.be/pQr6pnnZ6sA
This is a utility script that wraps Emacs client in order to automatically run a server configured to use a chemacs2 profile or a init-directory
.
It is going to pass to emacsclient
all the extra options that are not read out by the script.
For the options you can pass to emacsclient
refer to: https://www.gnu.org/software/emacs/manual/html_node/emacs/emacsclient-Options.html
It differs because when running emacsclient with -a
option I did not find a way to specify a profile or an init-directory
, which didn’t involve changing the startup script.
Also the script has some utility functions such as -l
that is going to list all the socket files currently available in the system.
This script expects emacs
and emacsclient
to be in the system and available.
Also uses lsof
to be installed in the system.
In order to use the --profile
option in the script, chemacs2 is expected to be installed and configured in the system.
The init-directory option relies on Emacs being v29.
ec
It will open a new instance of emacsclient
in a frame, called with -c
option.
In this case is going to call emacsclient
with =-a ”= option, which is going to start the server for the default profile of Emacs.
ec --profile <chemacs2-profile-name>
# or
ec --init-directory ~/init-directory
It’s going to just call Emacs client, since the socket already exists and it’s not required to create a new one. If you really want to run a second server besides you can always run the regular command:
emacs --bg-daemon=<deamon-name> --init-directory ~/init-directory
and then call the script with the -s
option for Emacs client to reference to that particular daemon that wants to be used.
ec -s <daemon-name>
It is going to start a new Emacs instance with a particular init-directory
or profile, and then it’s going to run the client associated with it.
ec -l
It will return a list of open Emacs sockets using lsof
.
ec -k
Or a specific daemon instance:
ec -k -s <name>
Just a few examples:
ec +18 ~/dotfiles/.config/conf.el
ec -s deamon-name +12 ~/my-file.org