Files
dotfiles/bin/emacs-gui-client
Jim Myhrberg 89fa2342d3 Add new emacs-gui-server and emacs-gui-client commands
The idea behind these commands is to easily launch a Emacs server which
runs in the background, but with font/theme/etc settings as if it was
launched like a normal GUI.

I used to just launch Emacs.app directly, but, now I use these binaries
to open a full GUI frame by executing `emacs-gui-client -c &`. After
starting the GUI server with `emacs-gui-server start` of course.

The main difference between calling `emacs --daemon` and
`emacs-gui-server start` is that the latter uses a custom socket as to
not interfere with any console-base Emacs server, and it also sets the
`EMACS_GUI_SERVER` environment variable to `1`, letting my Emacs config
figure out which theme/fonts/etc to load.
2013-02-18 01:02:56 +00:00

16 lines
453 B
Bash
Executable File

#! /bin/bash
# Defaults
SOCKET_DIR="$TMPDIR/emacs-gui-server$(id -u)"
SOCKET_FILE="$SOCKET_DIR/server"
EMACSCLIENT="emacsclient"
ALTERNATE_EDITOR="nano"
# Set to binary bundled in Emacs.app if it exists
if [ -f "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient" ]; then
EMACSCLIENT="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient"
fi
# Execute emacsclient
exec $EMACSCLIENT -s "$SOCKET_FILE" --alternate-editor=$ALTERNATE_EDITOR "$@"