From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: Tweaking magit/diff mode to be more helpful in text editing Date: Wed, 01 Jun 2016 13:08:37 +0800 Message-ID: <8737oxh4x6.fsf@ericabrahamsen.net> References: <87shwyvi0w.fsf@ericabrahamsen.net> <20160531075538.GA25176@tuxteam.de> <87h9ddsglu.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1464757768 4216 80.91.229.3 (1 Jun 2016 05:09:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jun 2016 05:09:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 01 07:09:19 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b7yP9-0001U0-A4 for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Jun 2016 07:09:19 +0200 Original-Received: from localhost ([::1]:39701 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7yP8-00035I-Jp for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Jun 2016 01:09:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7yOl-00035D-OI for help-gnu-emacs@gnu.org; Wed, 01 Jun 2016 01:08:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7yOi-00078S-F7 for help-gnu-emacs@gnu.org; Wed, 01 Jun 2016 01:08:55 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:46894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7yOi-00078K-84 for help-gnu-emacs@gnu.org; Wed, 01 Jun 2016 01:08:52 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b7yOf-00018Y-B3 for help-gnu-emacs@gnu.org; Wed, 01 Jun 2016 07:08:49 +0200 Original-Received: from 111.197.167.74 ([111.197.167.74]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 01 Jun 2016 07:08:49 +0200 Original-Received: from eric by 111.197.167.74 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 01 Jun 2016 07:08:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 111.197.167.74 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:eZaSzv8YT1ZYqCpmCvWcAz7Y3d0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:110159 Archived-At: Yuri Khan writes: > On Wed, Jun 1, 2016 at 10:00 AM, Eric Abrahamsen > wrote: >> writes: > >> I just found wdiff[1]! This looks to be exactly what I want, and it's >> got the right brand, too :) There's also something called adiff. >> >> I've installed it, and tweaked my git config so that I can call "git >> difftool --tool=wdiff" and see the diff using wdiff. Right now it spits >> out the whole file, not just changes-plus-context, but presumably I can >> figure out how to change that. > > Git also has a built-in wdiff-like mode. See git-diff(1) for > --word-diff, --word-diff-regex and --color-words. > --word-diff=porcelain might be especially useful for editor > integration. Well that's embarrassing. I was aware of --word-diff, but for some reason was totally sure that it only provided "extra" word-level context, but still marked refilled paragraphs as changes. Instead, it seems to do exactly what wdiff does. My apologies for insufficient prior Googling. It still doesn't work with Magit, but unsurprisingly the issue has already been discovered and discussed[1]. The Magit developers have said they won't support --word-diff, "not even read-only", because (as I guessed) the resulting diffs can't be used as diffs are supposed to be used: can't be applied, reverted, etc. So I'll be able to send a fairly useful document to my author, but if I want the benefit of --word-diff during editing, I'll need to write some sort of parser myself. Thanks for putting up with this inquiry! E [1]: https://github.com/magit/magit/issues/1615