Add function to start ediff from the command-line
This commit is contained in:
parent
298885434b
commit
3ba4243277
1 changed files with 9 additions and 1 deletions
10
oni-ediff.el
10
oni-ediff.el
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue