emacsclient.sh 392 B

123456789101112
  1. #!/bin/sh
  2. # get list of available X windows.
  3. x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`
  4. if [ -z "$x" ] || [ "$x" = "nil" ] ;then
  5. # Create one if there is no X window yet.
  6. emacsclient --alternate-editor "" --create-frame "$@"
  7. else
  8. # prevent creating another X frame if there is at least one present.
  9. emacsclient --alternate-editor "" "$@"
  10. fi