view emacs/ew @ 568:dd77081b7588

Prevent from interpreting file names as emacsclient options.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Sun, 12 Jan 2014 22:27:02 +0200
parents b8b028459622
children
line wrap: on
line source

#!/bin/sh
# Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008.

usage() {
  echo "Shortcut for emacsclient. See ew(1) man page."
  echo "Usage:"
  echo "  ew  file..."

}

case "$1" in
  -h|-help|--help)
    usage
    exit 0
    ;;
  "")
    printf "What file do you want to open?\n\n"
    usage
    exit 1
    ;;
esac

if [ -n "$COMSPEC" ]; then
  # We probably under Windows like OS.
  exec emacsclientw -a emacs -- "$@"
else
  exec emacsclient -a emacs -- "$@"
fi