From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Suvayu Ali Newsgroups: gmane.emacs.help Subject: Re: Highlighting word diffs Date: Sat, 18 Apr 2015 18:07:20 +0200 Message-ID: <20150418160720.GY14328@chitra.no-ip.org> References: <20150418075126.GW14328@chitra.no-ip.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1429373271 30849 80.91.229.3 (18 Apr 2015 16:07:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Apr 2015 16:07:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 18 18:07:41 2015 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 1YjVHQ-0002o8-1X for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Apr 2015 18:07:40 +0200 Original-Received: from localhost ([::1]:46158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjVHP-00035I-5d for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Apr 2015 12:07:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjVHC-00035B-Jq for help-gnu-emacs@gnu.org; Sat, 18 Apr 2015 12:07:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YjVH9-0007qg-Us for help-gnu-emacs@gnu.org; Sat, 18 Apr 2015 12:07:26 -0400 Original-Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:36462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjVH9-0007qc-MZ for help-gnu-emacs@gnu.org; Sat, 18 Apr 2015 12:07:23 -0400 Original-Received: by wizk4 with SMTP id k4so53301996wiz.1 for ; Sat, 18 Apr 2015 09:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=mxOJFtqIISCRqY3m5qa6kf4seo/9qP0MBGk68oOa+Ps=; b=PhVJAaaUo2JDpZSnQCDACu43+2GnQkYnA/ci8ZMidjJaEBKleeEpS+Nq/kCp4iI1xJ uVbSEy22TMFMTCEKkOV/iMYlOkiD6+O58AmWSbOnetcCAJ/TdX3bV0zt5NQm/yiBTFvT 7TP9sxsxW9Tgtv6oM/u8EpTOETxiRkjGXqdXEucnGurxLqkHMmEgYqUhqGPknNqmgKAp oZi1pHjckeiJ2j0dNWDdRNrbYof8ZKYtwn/FDjYjGTeXpLiHYhqYz5TLH0SQ98GNJwTL 9gzZ88+hateVLctc0H/Sg9JGurAaSVfrnxciQK5zBSFZkpMIpc1bHP2oBWEJEKMn2TF0 c78A== X-Received: by 10.194.19.197 with SMTP id h5mr15311436wje.109.1429373243100; Sat, 18 Apr 2015 09:07:23 -0700 (PDT) Original-Received: from chitra.no-ip.org (sd44012d5.adsl.online.nl. [212.64.18.213]) by mx.google.com with ESMTPSA id eh5sm7450077wic.20.2015.04.18.09.07.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Apr 2015 09:07:22 -0700 (PDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::232 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103825 Archived-At: Hi Stefan, On Sat, Apr 18, 2015 at 09:25:51AM -0400, Stefan Monnier wrote: > > I wanted to use word diffs for text-modes (i.e. Org, TeX, plain text, > > etc). So I change diff-switches in text-mode-hook, and the output looks > > as expected. > > I don't know how you changed diff-switches, and I don't know what this > expected output looks like, nor which command you used to get it. > This is how I set it: (setq vc-git-diff-switches (list "--word-diff")) And I use vc-diff to generate the diff. Here is a sample of how it looks: diff --git a/time-acceptance.org b/time-acceptance.org index 361a6ee..33fac7c 100644 --- a/time-acceptance.org +++ b/time-acceptance.org @@ -1,35 +1,43 @@ #+title: [-Decay time-]{+Decay-time+} dependent acceptance #+include: options.org #+include: macros.org * WInP [-Decay time-]{+Decay-time+} dependent acceptance :PROPERTIES: :CUSTOM_ID: ch:tacc :END: An ideal event selection would accept all events that are true signal events, and reject the rest. Reality is different however. Since the flight distance and [-decay time-]{+decay-time+} are directly related{{{todo(Cite eqn from introduction)}}}, some selection requirements related to the flight distance of the B_{s} meson could bias the sample of accepted events in [-decay time.-]{+decay-time[fn:: One might even think of this as a selection+} {+efficiency function.].+} The {+most effective+} selection [-requirement responsible could be any-]{+requirements are+} {+often designed to reject displaced vertices not associated with a+} {+B_{s} meson. Which is inevitably at odds with an unbiased decay-time.+} ... and so on. > > However the highlighting in diff-mode does not seem to work. > > I don't know how it fails to work either. I would expect the [-text-] bits to be coloured red, and {+text+} bits to be coloured green. That's what I get in the terminal with: $ git diff --word-diff Does that help? Is there support for this? If not, would it be a valid feature request? Thanks for any comments. -- Suvayu Open source is the future. It sets us free.