help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ediff on two files in two side by side emacs windows


From: Patrick Mahan
Subject: Re: ediff on two files in two side by side emacs windows
Date: Sat, 1 May 2021 17:13:14 -0700

On Sat, May 1, 2021 at 3:16 PM <wael-zwaiter@gmx.com> wrote:

> Would it be possible to write an elisp function to run ediff
> on two windows that I have in my emacs frame?
>
>
>
Do you mean something similar to the following:

;;
;; Add support for 'emacs -diff <file1> <file2>'
;;
(defun command-line-diff (switch)
  (let ((file1 (pop command-line-args-left))
         (file2 (pop command-line-args-right)))
    (setq ediff-window-setup-funciton 'ediff-setup-windows-plain)
    (setq ediff-split-window-function (if (> (frame-width) 150)

'split-window-horizontally

'split-window-vertically))
    (ediff file1 file2)))

(add-to-list 'command-switch-alist '("-diff" . command-line-diff))

Though I spend more time using vcs-ediff because of the various SCMs I work
with.

Patrick


reply via email to

[Prev in Thread] Current Thread [Next in Thread]