function escape_backslashes(path) return string.gsub(path, "\\", "\\\\") end do local old_emacs_merger = mergers.emacs mergers.emacs = { cmd = function (tbl) local emacs if program_exists_in_path("xemacs") then emacs = "xemacs" else emacs = "emacs" end local elisp = "(ediff-merge-files-with-ancestor \"%s\" \"%s\" \"%s\" nil \"%s\")" local ret = execute(emacs, "--eval", string.format(elisp, escape_backslashes(tbl.lfile), escape_backslashes(tbl.rfile), escape_backslashes(tbl.afile), escape_backslashes(tbl.outfile))) if (ret ~= 0) then io.write(string.format(gettext("Error running merger '%s'\n"), emacs)) return false end return tbl.outfile end, available = old_emacs_merger.available, wanted = old_emacs_merger.wanted } end