unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Ediff: compare two (long) buffers Word-by-word
@ 2018-11-24 19:33 ST
  2018-11-24 23:35 ` Oleg Cherkasov
  2018-11-25  9:17 ` Yuri Khan
  0 siblings, 2 replies; 7+ messages in thread
From: ST @ 2018-11-24 19:33 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I use Emacs 26.1 and try to compare two (long) buffers (opened side by
side) by clicking Tools -> Compare (Ediff) -> Windows Word-by-word...
Then I choose both Windows (A and B) by clicking on each opened buffer.
However it looks like Emacs compares only the visible parts of the two
buffers, not the whole buffers. Why?

I saw there is a command `ediff-windows-wordwise`... How is "Window"
defined? - as "currently visible part of a buffer"? If yes, is there
something like `ediff-buffers-wordwise`?

I have `git` in `exec-path`, so maybe I can make ediff to display the
output of `git diff --word-diff file1 file2` in ediff style?

https://emacs.stackexchange.com/questions/46161/ediff-compare-two-long-buffers-word-by-word

Thank you!




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

* Re: Ediff: compare two (long) buffers Word-by-word
       [not found] <mailman.4546.1543093349.1284.help-gnu-emacs@gnu.org>
@ 2018-11-24 22:26 ` B. T. Raven
  0 siblings, 0 replies; 7+ messages in thread
From: B. T. Raven @ 2018-11-24 22:26 UTC (permalink / raw)
  To: help-gnu-emacs

On 11/24/2018 1:33 PM, ST wrote:
> Hello,
> 
> I use Emacs 26.1 and try to compare two (long) buffers (opened side by
> side) by clicking Tools -> Compare (Ediff) -> Windows Word-by-word...
> Then I choose both Windows (A and B) by clicking on each opened buffer.
> However it looks like Emacs compares only the visible parts of the two
> buffers, not the whole buffers. Why?

If you display the same buffer in 2 windows and then scroll one window 
past what is displayed in the other window, ediff-windows-wordwise 
doesn't find any differences. I've never used it before and I don't know 
what it's usefulness might be. It must be some kind of
short-cut for ediff-buffers used with only 2 buffers.

> I saw there is a command `ediff-windows-wordwise`... How is "Window"
> defined? - as "currently visible part of a buffer"? If yes, is there
> something like `ediff-buffers-wordwise`?
A window is just the non-overlapping screen area where a buffer is 
displayed.
Type C-h f ediff- tab tab and you'll see all the ediff functions. 
ediff-buffers is probably the one you want. It can also be accessed from 
the menu.
> 
> I have `git` in `exec-path`, so maybe I can make ediff to display the
> output of `git diff --word-diff file1 file2` in ediff style?

Probably; M-! will let you enter a shell command.

> 
> https://emacs.stackexchange.com/questions/46161/ediff-compare-two-long-buffers-word-by-word
> 
> Thank you!
> 
> 

Ed



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

* Re: Ediff: compare two (long) buffers Word-by-word
  2018-11-24 19:33 Ediff: compare two (long) buffers Word-by-word ST
@ 2018-11-24 23:35 ` Oleg Cherkasov
  2018-11-25  9:17 ` Yuri Khan
  1 sibling, 0 replies; 7+ messages in thread
From: Oleg Cherkasov @ 2018-11-24 23:35 UTC (permalink / raw)
  To: help-gnu-emacs

On 24.11.2018 20:33, ST wrote:
> Hello,
> 
> I use Emacs 26.1 and try to compare two (long) buffers (opened side by
> side) by clicking Tools -> Compare (Ediff) -> Windows Word-by-word...
> Then I choose both Windows (A and B) by clicking on each opened buffer.
> However it looks like Emacs compares only the visible parts of the two
> buffers, not the whole buffers. Why?
> 
> I saw there is a command `ediff-windows-wordwise`... How is "Window"
> defined? - as "currently visible part of a buffer"? If yes, is there
> something like `ediff-buffers-wordwise`?
> 
> I have `git` in `exec-path`, so maybe I can make ediff to display the
> output of `git diff --word-diff file1 file2` in ediff style?
> 
> https://emacs.stackexchange.com/questions/46161/ediff-compare-two-long-buffers-word-by-word

Long time ago I found 'compare-windows' very useful comparing two 
buffers line by line.  Set cursor to start position on one buffer and 
then another and M-x compare-windows.




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

* Re: Ediff: compare two (long) buffers Word-by-word
  2018-11-24 19:33 Ediff: compare two (long) buffers Word-by-word ST
  2018-11-24 23:35 ` Oleg Cherkasov
@ 2018-11-25  9:17 ` Yuri Khan
  2018-11-25 13:48   ` ST
  2018-11-27  8:12   ` Eli Zaretskii
  1 sibling, 2 replies; 7+ messages in thread
From: Yuri Khan @ 2018-11-25  9:17 UTC (permalink / raw)
  To: smntov; +Cc: help-gnu-emacs

On Sun, Nov 25, 2018 at 4:02 AM ST <smntov@gmail.com> wrote:

> I use Emacs 26.1 and try to compare two (long) buffers (opened side by
> side) by clicking Tools -> Compare (Ediff) -> Windows Word-by-word...
> Then I choose both Windows (A and B) by clicking on each opened buffer.
> However it looks like Emacs compares only the visible parts of the two
> buffers, not the whole buffers. Why?
>
> I saw there is a command `ediff-windows-wordwise`... How is "Window"
> defined? - as "currently visible part of a buffer"? If yes, is there
> something like `ediff-buffers-wordwise`?

‘ediff-windows-wordwise’ calls ‘ediff-windows’ which calls
‘ediff-regions-internal’, passing to it the two chosen windows and
their respective visible parts. ‘ediff-windows-linewise’ behaves the
same way.

This is not documented in their docstrings nor in Info. Moreover,
(info "(ediff) Major Entry Points") contains the following wording:

> The commands ‘ediff-windows-wordwise’
> and ‘ediff-regions-wordwise’ are intended for relatively small segments
> of buffers (e.g., up to 100 lines, depending on the speed of your
> machine)

which suggests that ‘ediff-windows-*’ should work for 100-line
fragments, and that will only fit in a visible part of a window with a
very small font.

There is no command ‘ediff-buffers-wordwise’; maybe this is because of
performance concerns. You can compare buffers using
‘ediff-regions-wordwise’; after you specify two buffers, it will ask
you to select a region and press C-M-c to proceed, in each buffer.

> I have `git` in `exec-path`, so maybe I can make ediff to display the
> output of `git diff --word-diff file1 file2` in ediff style?

There are customizable variables ‘ediff-diff-program’ and
‘ediff-diff-options’, but I do not know what happens if you plug ‘git’
and ‘diff --no-index --word-diff’ there.

You should also try refinement. After starting Ediff linewise,
navigate to a diff region (‘n’ in the Ediff control window) and press
‘*’. Ediff will highlight word differences in place.



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

* Re: Ediff: compare two (long) buffers Word-by-word
  2018-11-25  9:17 ` Yuri Khan
@ 2018-11-25 13:48   ` ST
  2018-11-27  8:16     ` Eli Zaretskii
  2018-11-27  8:12   ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: ST @ 2018-11-25 13:48 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs




On Sun, 2018-11-25 at 16:17 +0700, Yuri Khan wrote:
> On Sun, Nov 25, 2018 at 4:02 AM ST <smntov@gmail.com> wrote:
> 
> > I use Emacs 26.1 and try to compare two (long) buffers (opened side by
> > side) by clicking Tools -> Compare (Ediff) -> Windows Word-by-word...
> > Then I choose both Windows (A and B) by clicking on each opened buffer.
> > However it looks like Emacs compares only the visible parts of the two
> > buffers, not the whole buffers. Why?
> >
> > I saw there is a command `ediff-windows-wordwise`... How is "Window"
> > defined? - as "currently visible part of a buffer"? If yes, is there
> > something like `ediff-buffers-wordwise`?
> 
> ‘ediff-windows-wordwise’ calls ‘ediff-windows’ which calls
> ‘ediff-regions-internal’, passing to it the two chosen windows and
> their respective visible parts. ‘ediff-windows-linewise’ behaves the
> same way.
> 
> This is not documented in their docstrings nor in Info. Moreover,
> (info "(ediff) Major Entry Points") contains the following wording:
> 
> > The commands ‘ediff-windows-wordwise’
> > and ‘ediff-regions-wordwise’ are intended for relatively small segments
> > of buffers (e.g., up to 100 lines, depending on the speed of your
> > machine)
> 
> which suggests that ‘ediff-windows-*’ should work for 100-line
> fragments, and that will only fit in a visible part of a window with a
> very small font.
> 
> There is no command ‘ediff-buffers-wordwise’; maybe this is because of
> performance concerns. You can compare buffers using
> ‘ediff-regions-wordwise’; after you specify two buffers, it will ask
> you to select a region and press C-M-c to proceed, in each buffer.

Somebody has provided a solution which seems to work very good without
any performance issues. There is a small error message, though...

https://emacs.stackexchange.com/questions/46161/ediff-compare-two-long-buffers-word-by-word

I assume the performance concerns where relevant 15-20 years ago
(presumably the time when those lines of the docs were written).

If it is easier, then comparing two files word-by-word, would also be a
nice feature:

https://emacs.stackexchange.com/questions/46206/ediff-compare-two-files-word-by-word

If this mailing list is the proper place to ask for enhancements: could
those two functions(/menu options) be added to Emacs, please?

Thank you!




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

* Re: Ediff: compare two (long) buffers Word-by-word
  2018-11-25  9:17 ` Yuri Khan
  2018-11-25 13:48   ` ST
@ 2018-11-27  8:12   ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2018-11-27  8:12 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Yuri Khan <yurivkhan@gmail.com>
> Date: Sun, 25 Nov 2018 16:17:08 +0700
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> ‘ediff-windows-wordwise’ calls ‘ediff-windows’ which calls
> ‘ediff-regions-internal’, passing to it the two chosen windows and
> their respective visible parts. ‘ediff-windows-linewise’ behaves the
> same way.
> 
> This is not documented in their docstrings nor in Info. Moreover,
> (info "(ediff) Major Entry Points") contains the following wording:
> 
> > The commands ‘ediff-windows-wordwise’
> > and ‘ediff-regions-wordwise’ are intended for relatively small segments
> > of buffers (e.g., up to 100 lines, depending on the speed of your
> > machine)
> 
> which suggests that ‘ediff-windows-*’ should work for 100-line
> fragments, and that will only fit in a visible part of a window with a
> very small font.

Thanks, I fixed the documentation to be more explicit about what is
being compared by these functions.



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

* Re: Ediff: compare two (long) buffers Word-by-word
  2018-11-25 13:48   ` ST
@ 2018-11-27  8:16     ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2018-11-27  8:16 UTC (permalink / raw)
  To: help-gnu-emacs

> From: ST <smntov@gmail.com>
> Date: Sun, 25 Nov 2018 15:48:32 +0200
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> Somebody has provided a solution which seems to work very good without
> any performance issues. There is a small error message, though...
> 
> https://emacs.stackexchange.com/questions/46161/ediff-compare-two-long-buffers-word-by-word

I still am not sure I understand what's wrong with the existing
command ediff-regions-wordwise.

> I assume the performance concerns where relevant 15-20 years ago
> (presumably the time when those lines of the docs were written).

It could be.  I removed from the documentation the numbers that
defined "large", however in general, for some value of "large" you
will still see slower performance from wordwise comparison compared to
the linewise comparison.

> If it is easier, then comparing two files word-by-word, would also be a
> nice feature:
> 
> https://emacs.stackexchange.com/questions/46206/ediff-compare-two-files-word-by-word

Again, why doesn't ediff-regions-wordwise fit the bill?

> If this mailing list is the proper place to ask for enhancements: could
> those two functions(/menu options) be added to Emacs, please?

Bugs and enhancement request should be submitted using
report-emacs-bug, thank you.



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

end of thread, other threads:[~2018-11-27  8:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-24 19:33 Ediff: compare two (long) buffers Word-by-word ST
2018-11-24 23:35 ` Oleg Cherkasov
2018-11-25  9:17 ` Yuri Khan
2018-11-25 13:48   ` ST
2018-11-27  8:16     ` Eli Zaretskii
2018-11-27  8:12   ` Eli Zaretskii
     [not found] <mailman.4546.1543093349.1284.help-gnu-emacs@gnu.org>
2018-11-24 22:26 ` B. T. Raven

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).