Skip to content

Instantly share code, notes, and snippets.

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 zaxebo1/ac3f55caa450deb31eeae8c9ed5d18bd to your computer and use it in GitHub Desktop.
Save zaxebo1/ac3f55caa450deb31eeae8c9ed5d18bd to your computer and use it in GitHub Desktop.
Get Emacs workspace for each GNU screen
setenv DEFAULT_WORKSPACE "default"
if ( $?WORKSPACE == 0 ) then
setenv WORKSPACE $DEFAULT_WORKSPACE
endif
# Define alias 'et' to connect to the proper Emacs server identified by EMACS_SEVER_NAME
setenv EDITOR "emacsclient -s $WORKSPACE -t -a ''"
alias et "$EDITOR"
# Create alias 'kill-emacs' to kill proper Emacs server.
alias kill-emacs "$EDITOR --eval '(kill-emacs)'"
alias start-emacs-server "emacs --daemon=$WORKSPACE"
# $WINDOW is set by GNU screen to indicate current window number.
if ( $?WINDOW ) then
# Create aliase to start dvtm session for each window in a workspace
alias dvtm "dtach -A /tmp/dvtm-session-${WORKSPACE}-${WINDOW} dvtm"
else
# Create convenient aliases for creating workspaces only
# when not inside GNU screen to avoid accidentally starting GNU screen inside GNU screen.
foreach p ( study bozaalarm bug $DEFAULT_WORKSPACE )
alias ws-$p "setenv WORKSPACE $p; screen -mS $p -DR"
end
foreach s ( 1 2 3 4 5 6 7 8 9 )
alias dvtm$s "dtach -A /tmp/dvtm-session-${WORKSPACE}-$s dvtm"
end
alias dvtm "dtach -A /tmp/dvtm-session dvtm"
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment