Skip to content

Instantly share code, notes, and snippets.

@tasmo
Created September 23, 2016 19:32
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