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: wael-zwaiter
Subject: Re: ediff on two files in two side by side emacs windows
Date: Sun, 2 May 2021 06:19:35 +0200

   I have a problem seeing what "command-line-diff" does and how to use
   it.

   Sent: Sunday, May 02, 2021 at 12:13 PM
   From: "Patrick Mahan" <plmahan@gmail.com>
   To: wael-zwaiter@gmx.com
   Cc: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
   Subject: Re: ediff on two files in two side by side emacs windows

   On Sat, May 1, 2021 at 3:16 PM <[1]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

References

   1. mailto:wael-zwaiter@gmx.com


reply via email to

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