-
-
Save Khoulaiz/4855ad7812397a8c51a9ed12b91060e6 to your computer and use it in GitHub Desktop.
snipped for ediff with emacsclient for POSIX shells
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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