Skip to content

Instantly share code, notes, and snippets.

@Khoulaiz
Forked from tasmo/.profile
Created May 16, 2017 20:54
Show Gist options
  • Save Khoulaiz/4855ad7812397a8c51a9ed12b91060e6 to your computer and use it in GitHub Desktop.
Save Khoulaiz/4855ad7812397a8c51a9ed12b91060e6 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