Skip to content

Instantly share code, notes, and snippets.

@opie4624
Created September 7, 2009 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save opie4624/182226 to your computer and use it in GitHub Desktop.
Save opie4624/182226 to your computer and use it in GitHub Desktop.
Make emacsclient an easy habit!
Set an environment variable called ALTERNATE_EDITOR to point to this script. Then get in the habit of using emacsclient always. This will fire up emacs and wait for the server to start then fire up the file passed in via emacs client.
Right now it only works if your emacs will come up on your window manager, because that's primarily how I use it.
-Opie
#!/bin/bash
EMACSBIN=/usr/bin/emacs
EMACSCLIENTBIN=/usr/bin/emacsclient
ALTERNATE_EDITOR=
$EMACSBIN -f server-start &
while !($EMACSCLIENTBIN $@) do
sleep 2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment