Skip to content

Instantly share code, notes, and snippets.

@tasmo
Created September 23, 2016 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tasmo/c6bd7576f7f090a9c206099cf88a58d9 to your computer and use it in GitHub Desktop.
Save tasmo/c6bd7576f7f090a9c206099cf88a58d9 to your computer and use it in GitHub Desktop.
snipped for ediff with emacsclient for POSIX shells
### editor
export ALTERNATE_EDITOR=emacs
export EDITOR="emacsclient -tc -a emacs"
export VISUAL="emacsclient -c -a emacs"
# emacsclient as difftool
function ediff () {
if [ "X${2}" = "X" ]; then
echo "USAGE: ediff <FILE 1> <FILE 2>"
else
quoted1=${1//\\/\\\\}; quoted1=${quoted1//\"/\\\"}
quoted2=${2//\\/\\\\}; quoted2=${quoted2//\"/\\\"}
emacsclient -tc -a emacs -e "(ediff \"$quoted1\" \"$quoted2\")"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment