diff options
author | Tom Willemse | 2019-10-10 17:02:34 -0700 |
---|---|---|
committer | Tom Willemse | 2019-10-10 17:08:23 -0700 |
commit | 3ba42432772b80ac75d7257c7a1737bbd3549f64 (patch) | |
tree | 0f78ad01022e7687d3c53b573673580fa801a6a1 /oni-ediff.el | |
parent | 298885434b3375ab254ec36a4dd4d2c721da2618 (diff) | |
download | emacs-config-3ba42432772b80ac75d7257c7a1737bbd3549f64.tar.gz emacs-config-3ba42432772b80ac75d7257c7a1737bbd3549f64.zip |
Add function to start ediff from the command-line
Diffstat (limited to 'oni-ediff.el')
-rw-r--r-- | oni-ediff.el | 10 |
1 files changed, 9 insertions, 1 deletions
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 <tom@ryuslash.org> ;; 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) |