Created
June 13, 2012 01:47
-
-
Save bamanzi/2921296 to your computer and use it in GitHub Desktop.
[emacs] ediff command line launcher
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
#!/usr/bin/python | |
# on windows, you can use cx-freeze to make an exe for this | |
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]) | |
if os.sep=="/": # windows | |
file1=file1.replace("\\", "/") | |
file2=file2.replace("\\", "/") | |
cmd = """emacsclient --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