From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Ediff: compare two (long) buffers Word-by-word Date: Sun, 25 Nov 2018 16:17:08 +0700 Message-ID: References: <1543088011.1851.5.camel@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1543138067 8154 195.159.176.226 (25 Nov 2018 09:27:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2018 09:27:47 +0000 (UTC) Cc: help-gnu-emacs To: smntov@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 25 10:27:43 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gQqhb-00021F-Ei for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Nov 2018 10:27:43 +0100 Original-Received: from localhost ([::1]:59237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQqjh-0005CB-Kq for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Nov 2018 04:29:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQqiZ-0003i8-Ph for help-gnu-emacs@gnu.org; Sun, 25 Nov 2018 04:28:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQqXb-0006PU-BL for help-gnu-emacs@gnu.org; Sun, 25 Nov 2018 04:17:24 -0500 Original-Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]:43980) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gQqXb-0006OU-5v for help-gnu-emacs@gnu.org; Sun, 25 Nov 2018 04:17:23 -0500 Original-Received: by mail-oi1-x232.google.com with SMTP id u18so13195223oie.10 for ; Sun, 25 Nov 2018 01:17:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=BBzajh4i5UWzwM2y5CE2waLLOGd2Y8/SYc0H0ht/cek=; b=HFP9YuxdSYdA46ZznhKIpEX5wqZ4yoqOqhFi1n3ELqHmFOqMx873UutE09Q1LW3hfh osklmqkJORyqRN/BPJrD2hGk8UPGBSGD3eygX3RR2CnJOD5t0p/Wa6EqKt9dQhtaFvRs cRjc1y6FMUQ8IsODgHXM+pe07tkygl2Lv3iq4Nxqxuf6j6QIJ/RV9t2q8KmZ81Yvpvv+ ujX8I+JcxuLYyZ+FKumiesKAUX19lq5cvpWr3chaxML32xxIKeM/oqX6OJ2h4derm6Ah P/VcqMu/MFOqAMRN1HUc8qFR49+6q240LANCfhQaswkeP2azersaCFyxTJCl01V0s5gd 3hJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=BBzajh4i5UWzwM2y5CE2waLLOGd2Y8/SYc0H0ht/cek=; b=QgY/TLDSelYkuwDfrlgxA4ucnk0zYUfOWiEDeBTMTBDfNvDkwn7arWJq12zFI+7srU uALG7OyrB0yJ+RmThkruv9kJba7JNgeYgEapS712osGwc0U6VYOdAaTyIivk2za4tV8G PN6hTLyj1gvoV3KR65n7OXnRCzY+hmweVTz2FQavv/Uz0VwJgWRPmIxzBcpMi1cnEp6R clieBsFOHEX5cVI5fBubBI+XQeLNHGr3Kddlpm2pnRTkV57+V3YoTcmPmfxPzgn19UX4 liVzruDAjgC86JPCDtUARWDVTFdrnbVVMJ1bemyzfuk0lhWckxt9SrSEX5EAFpW5wXaI eWGA== X-Gm-Message-State: AGRZ1gI8KaKQBzpL/DeOeiB/iTW32QTU5LDrqMpKTZSA9ytlhnMEXCwl JUzoEvorW7PhDCn4Tnsk7IsLTtk3qio6VSE+2Ms= X-Google-Smtp-Source: AJdET5dDDXceEVMrBng0Ny27eOFtbzxtm2l19+j9FbvN5ihM9ra1Yjr6hRrkj2Ur58fB06cZdNxWXr/WczA/BoffFq8= X-Received: by 2002:aca:5907:: with SMTP id n7-v6mr13259022oib.166.1543137441205; Sun, 25 Nov 2018 01:17:21 -0800 (PST) In-Reply-To: <1543088011.1851.5.camel@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::232 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118748 Archived-At: On Sun, Nov 25, 2018 at 4:02 AM ST 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`? =E2=80=98ediff-windows-wordwise=E2=80=99 calls =E2=80=98ediff-windows=E2=80= =99 which calls =E2=80=98ediff-regions-internal=E2=80=99, passing to it the two chosen wind= ows and their respective visible parts. =E2=80=98ediff-windows-linewise=E2=80=99 be= haves 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 =E2=80=98ediff-windows-wordwise=E2=80=99 > and =E2=80=98ediff-regions-wordwise=E2=80=99 are intended for relatively = small segments > of buffers (e.g., up to 100 lines, depending on the speed of your > machine) which suggests that =E2=80=98ediff-windows-*=E2=80=99 should work for 100-l= ine fragments, and that will only fit in a visible part of a window with a very small font. There is no command =E2=80=98ediff-buffers-wordwise=E2=80=99; maybe this is= because of performance concerns. You can compare buffers using =E2=80=98ediff-regions-wordwise=E2=80=99; 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 =E2=80=98ediff-diff-program=E2=80=99 and =E2=80=98ediff-diff-options=E2=80=99, but I do not know what happens if you= plug =E2=80=98git=E2=80=99 and =E2=80=98diff --no-index --word-diff=E2=80=99 there. You should also try refinement. After starting Ediff linewise, navigate to a diff region (=E2=80=98n=E2=80=99 in the Ediff control window)= and press =E2=80=98*=E2=80=99. Ediff will highlight word differences in place.