From 3ba42432772b80ac75d7257c7a1737bbd3549f64 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 10 Oct 2019 17:02:34 -0700 Subject: Add function to start ediff from the command-line --- oni-ediff.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'oni-ediff.el') diff --git a/oni-ediff.el b/oni-ediff.el index f8917de..6d87d27 100644 --- a/oni-ediff.el +++ b/oni-ediff.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2019.0904.210509 +;; Version: 2019.1010.164050 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -39,6 +39,14 @@ '(fullscreen fullboth)) (set-frame-parameter nil 'fullscreen nil))) +;;;###autoload +(defun oni-ediff-from-command-line () + "Call ‘ediff’ with arguments from the command line." + (pcase command-line-args-left + (`(,fileA ,fileB) (ediff-files fileA fileB)) + (`(,fileA ,fileB ,fileC) (ediff-files3 fileA fileB fileC)) + (_ (error "Invalid number of arguments, need either 2 or 3 files")))) + (setq ediff-window-setup-function 'ediff-setup-windows-plain) (setq ediff-split-window-function 'split-window-horizontally) -- cgit v1.2.3-54-g00ecf