Skip to content

Instantly share code, notes, and snippets.

@wandersoncferreira
Created January 9, 2018 02:59
Show Gist options
  • Save wandersoncferreira/3ecd451deed2b83209afe82e70b2de0e to your computer and use it in GitHub Desktop.
Save wandersoncferreira/3ecd451deed2b83209afe82e70b2de0e to your computer and use it in GitHub Desktop.
Script to open Emacs in Terminal mode using the same daemon server
#!/bin/bash
# Makes sure emacs daemon is running and opens the file in Emacs in
# the terminal.
# If you want to execute elisp, use -e whatever, like so
# et -e "(message \"Word up\")"
# You may want to redirect that to /dev/null if you don't want the
# return to printed on the terminal. Also, just echoing a message
# may not be visible if Emacs then gives you a message about what
# to do when do with the frame
# The compliment to this script is ec
# Emacsclient option reference
# -a "" starts emacs daemon and reattaches
# -t starts in terminal, since I won't be using the gui
# can also pass in -n if you want to have the shell return right away
exec emacsclient -a "" -t "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment