Other Help with emacs command line

I'm trying to start up emacs and run the ediff-files command to compare two files passed via the command line, but haven't figured it out yet.

I think this must be somewhere close:-
emacs -nw --eval "(ediff-files)" $1 $2

Can anyone help me get this working?
 
Have you tried using Meld as an alternative

Meld is a visual diff and merge tool targeted at developers.
Meld helps you compare files, directories, and version controlled projects.
 
Try this: emacs -nw --eval '(ediff-files "path/to/file1" "path/to/file2")'.


Thanks. That works great but I'd like to pass the filenames to the command as parameters.

Just using $1 $2 doesn't work. Don't know if the $ needs to be escaped...
 
There you go:
Bash:
#!/bin/sh
if [ $# -eq 2 ] ; then
    cmd=\(ediff-files\ \""$1"\"\ \""$2"\"\)
    emacs -nw --eval "${cmd}"
else
    echo usage: idiff file1 file2
fi

PS: Not bulletproof, tho :)
 
Back
Top