unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* ediff on two files in two side by side emacs windows
@ 2021-05-01 22:14 wael-zwaiter
  2021-05-01 22:22 ` Gregory Heytings
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: wael-zwaiter @ 2021-05-01 22:14 UTC (permalink / raw)
  To: Help Gnu Emacs

Would it be possible to write an elisp function to run ediff
on two windows that I have in my emacs frame?






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ediff on two files in two side by side emacs windows
  2021-05-01 22:14 ediff on two files in two side by side emacs windows wael-zwaiter
@ 2021-05-01 22:22 ` Gregory Heytings
  2021-05-01 22:35 ` Skip Montanaro
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Gregory Heytings @ 2021-05-01 22:22 UTC (permalink / raw)
  To: wael-zwaiter; +Cc: help-gnu-emacs


>
> Would it be possible to write an elisp function to run ediff on two 
> windows that I have in my emacs frame?
>

Does (setq ediff-split-window-function #'split-window-horizontally) do 
what you want?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ediff on two files in two side by side emacs windows
  2021-05-01 22:14 ediff on two files in two side by side emacs windows wael-zwaiter
  2021-05-01 22:22 ` Gregory Heytings
@ 2021-05-01 22:35 ` Skip Montanaro
  2021-05-02  0:13 ` Patrick Mahan
  2021-05-02  6:54 ` Eli Zaretskii
  3 siblings, 0 replies; 6+ messages in thread
From: Skip Montanaro @ 2021-05-01 22:35 UTC (permalink / raw)
  To: wael-zwaiter; +Cc: Help Gnu Emacs

> Would it be possible to write an elisp function to run ediff
> on two windows that I have in my emacs frame?

When running ediff,  '|' is bound to ediff-toggle-split. In general,
'?' presents me with all the key shortcuts I need (a second '?'
dismisses the cheat sheet).

Skip



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ediff on two files in two side by side emacs windows
  2021-05-01 22:14 ediff on two files in two side by side emacs windows wael-zwaiter
  2021-05-01 22:22 ` Gregory Heytings
  2021-05-01 22:35 ` Skip Montanaro
@ 2021-05-02  0:13 ` Patrick Mahan
  2021-05-02  4:19   ` wael-zwaiter
  2021-05-02  6:54 ` Eli Zaretskii
  3 siblings, 1 reply; 6+ messages in thread
From: Patrick Mahan @ 2021-05-02  0:13 UTC (permalink / raw)
  To: wael-zwaiter; +Cc: Help Gnu Emacs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ediff on two files in two side by side emacs windows
  2021-05-02  0:13 ` Patrick Mahan
@ 2021-05-02  4:19   ` wael-zwaiter
  0 siblings, 0 replies; 6+ messages in thread
From: wael-zwaiter @ 2021-05-02  4:19 UTC (permalink / raw)
  To: Patrick Mahan; +Cc: Help Gnu Emacs

   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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ediff on two files in two side by side emacs windows
  2021-05-01 22:14 ediff on two files in two side by side emacs windows wael-zwaiter
                   ` (2 preceding siblings ...)
  2021-05-02  0:13 ` Patrick Mahan
@ 2021-05-02  6:54 ` Eli Zaretskii
  3 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2021-05-02  6:54 UTC (permalink / raw)
  To: help-gnu-emacs

> From: wael-zwaiter@gmx.com
> Date: Sun, 2 May 2021 00:14:21 +0200
> Sensitivity: Normal
> 
> Would it be possible to write an elisp function to run ediff
> on two windows that I have in my emacs frame?

There are already 2 commands to do that: ediff-windows-linewise and
ediff-windows-wordwise.  Is that what you want?



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-02  6:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-01 22:14 ediff on two files in two side by side emacs windows wael-zwaiter
2021-05-01 22:22 ` Gregory Heytings
2021-05-01 22:35 ` Skip Montanaro
2021-05-02  0:13 ` Patrick Mahan
2021-05-02  4:19   ` wael-zwaiter
2021-05-02  6:54 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).