I'm pretty sure there are other solutions, but you can do this using --eval
instead of -f
(--funcall
):
emacs --eval '(ediff-files "file1" "file2")'
In fact, the Emacs manual on "Command Line Arguments for Emacs Invocation" says that -f function
and --funcall function
Call Lisp function function. If it is an interactive function (a command), it reads the arguments interactively just as if you had called the same function with a key sequence. Otherwise, it calls the function with no arguments.
This explains why you can not get the behavior you want with -f
/--funcall
.
ediff-directories
takes three arguments, so the command shown above changes to
emacs --eval '(ediff-directories "dir1" "dir2" "regexp")'
As explained here, ediff-directories
causes Emacs to enter ediff-meta-mode
, so you'll be dropped into the "Ediff Session Group Panel" first. To display the actual diff, just hit D (ediff-show-dir-diffs
).