1
0
Fork 0

Add function to start ediff from the command-line

This commit is contained in:
Tom Willemse 2019-10-10 17:02:34 -07:00
parent 298885434b
commit 3ba4243277

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210509 ;; Version: 2019.1010.164050
;; This program is free software; you can redistribute it and/or modify ;; 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 ;; it under the terms of the GNU General Public License as published by
@ -39,6 +39,14 @@
'(fullscreen fullboth)) '(fullscreen fullboth))
(set-frame-parameter nil 'fullscreen nil))) (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-window-setup-function 'ediff-setup-windows-plain)
(setq ediff-split-window-function 'split-window-horizontally) (setq ediff-split-window-function 'split-window-horizontally)