all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Highlighting word diffs
Date: Sat, 18 Apr 2015 18:07:20 +0200	[thread overview]
Message-ID: <20150418160720.GY14328@chitra.no-ip.org> (raw)
In-Reply-To: <jwv4modwovc.fsf-monnier+gmane.emacs.help@gnu.org>

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.



  reply	other threads:[~2015-04-18 16:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-18  7:51 Highlighting word diffs Suvayu Ali
2015-04-18 13:25 ` Stefan Monnier
2015-04-18 16:07   ` Suvayu Ali [this message]
2015-04-18 16:46     ` Stefan Monnier
2015-04-18 16:58       ` Marcin Borkowski
2015-04-19  1:41         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150418160720.GY14328@chitra.no-ip.org \
    --to=fatkasuvayu+linux@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.