Skip to content

Instantly share code, notes, and snippets.

@alex2600
Forked from bamanzi/ediff.py
Last active October 5, 2018 11:56
Show Gist options
  • Save alex2600/8a27a4abdb64115b39716a67876d3f8d to your computer and use it in GitHub Desktop.
Save alex2600/8a27a4abdb64115b39716a67876d3f8d to your computer and use it in GitHub Desktop.
[emacs] ediff command line launcher
#!/usr/bin/python
# diff and merge two files using emacs ediff-mode
import os
import os.path
import sys
if len(sys.argv)<3:
sys.stderr.write("Usage: ediff file1 file2")
else:
file1 = os.path.abspath(sys.argv[1])
file2 = os.path.abspath(sys.argv[2])
cmd = """emacs --eval "(ediff-files \\"%s\\" \\"%s\\")" """ % (file1, file2)
print cmd
os.system(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment