Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Diff could also show the changes within lines
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 33 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tom  
View profile  
 More options Oct 5 2012, 10:37 am
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Fri, 5 Oct 2012 14:37:07 +0000 (UTC)
Local: Fri, Oct 5 2012 10:37 am
Subject: Diff could also show the changes within lines
When doing diffs it often occurs to me the diff output could be
more readable if it showed the actual changes within lines.

Something like this (I mean the concept, the actual implemenation shown
may not be the best output which can be achieved), so you don't have to
search for the changes within the line:

http://stackoverflow.com/questions/1265949/multiple-changes-in-one-li...
tool/1266114#1266114

It doesn't even necessarily need support from the external diff tool,
because diffs are usually not huge, so the highlighting of the changes
could be done in lisp by parsing the diff output.

Has anyone tried improving diff like this? Is there a package which does
this?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Drew Adams  
View profile  
 More options Oct 5 2012, 10:40 am
Newsgroups: gnu.emacs.help
From: "Drew Adams" <drew.ad...@oracle.com>
Date: Fri, 5 Oct 2012 07:39:47 -0700
Local: Fri, Oct 5 2012 10:39 am
Subject: RE: Diff could also show the changes within lines

> Has anyone tried improving diff like this? Is there a package
> which does this?

ediff

E.g. `M-x ediff-buffers'


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Oct 5 2012, 10:47 am
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Fri, 5 Oct 2012 14:47:06 +0000 (UTC)
Local: Fri, Oct 5 2012 10:47 am
Subject: Re: Diff could also show the changes within lines
Drew Adams <drew.adams <at> oracle.com> writes:

> > Has anyone tried improving diff like this? Is there a package
> > which does this?

> ediff

> E.g. `M-x ediff-buffers'

Okay, but I mean output from git/mercurial/etc. when I get
a file history from emacs, or diff between versions, etc.

These commands invoke diff, and I like the single buffer diff
output, I don't need ediff showing diffs in two windows, etc.
that's why I think improving the regular diff output could
be useful.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
chandan r  
View profile  
 More options Oct 5 2012, 10:53 am
Newsgroups: gnu.emacs.help
From: chandan r <chandanrm...@gmail.com>
Date: Fri, 05 Oct 2012 20:39:11 +0530
Local: Fri, Oct 5 2012 11:09 am
Subject: Re: Diff could also show the changes within lines

Add the following to your Emacs init file:

(add-hook 'diff-mode-hook
          (lambda () (diff-auto-refine-mode 1)))


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Oct 5 2012, 11:00 am
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Fri, 5 Oct 2012 14:57:19 +0000 (UTC)
Local: Fri, Oct 5 2012 10:57 am
Subject: Re: Diff could also show the changes within lines
chandan r <chandanrmail <at> gmail.com> writes:

> Add the following to your Emacs init file:

> (add-hook 'diff-mode-hook
>      (lambda () (diff-auto-refine-mode 1)))

Wow, I'm impressed. Builtin Emacs features can still surprise me after
all these years. Thanks.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Oct 5 2012, 12:26 pm
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Fri, 5 Oct 2012 16:26:03 +0000 (UTC)
Local: Fri, Oct 5 2012 12:26 pm
Subject: Re: Diff could also show the changes within lines
Tom <adatgyujto <at> gmail.com> writes:

> chandan r <chandanrmail <at> gmail.com> writes:

> > Add the following to your Emacs init file:

> > (add-hook 'diff-mode-hook
> >         (lambda () (diff-auto-refine-mode 1)))

> Wow, I'm impressed. Builtin Emacs features can still surprise me after
> all these years. Thanks.

Looks like it does not work with DVC diff, so it needs to be disabled for
that:

  (unless (or (eq this-command 'dvc-diff)
              (eq this-command 'dvc-generic-refresh))
    (diff-auto-refine-mode 1))


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Doug Lewan  
View profile  
 More options Oct 5 2012, 12:31 pm
Newsgroups: gnu.emacs.help
From: Doug Lewan <do...@shubertticketing.com>
Date: Fri, 5 Oct 2012 16:32:07 +0000
Local: Fri, Oct 5 2012 12:32 pm
Subject: RE: Diff could also show the changes within lines
Tom,

If you're working with software that VC supports (RCS, CVS, there are external packages for others too), then you can also do M-x ediff-revision.

,Doug


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Oct 5 2012, 2:11 pm
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Fri, 5 Oct 2012 18:11:18 +0000 (UTC)
Local: Fri, Oct 5 2012 2:11 pm
Subject: Re: Diff could also show the changes within lines
Tom <adatgyujto <at> gmail.com> writes:

>     (diff-auto-refine-mode 1)

Turns out it only refines one hunk (the current) and the others only
if you use hunk navigation commands (diff-auto-refine-mode does this which
is on by default in Emacs 24). So to refine all hunks automatically,
do this in the diff hook:

  (save-excursion
    (goto-char (point-min))
    (while (not (eobp))
      (diff-hunk-next))))


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Monnier  
View profile  
 More options Oct 6 2012, 9:10 am
Newsgroups: gnu.emacs.help
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Sat, 06 Oct 2012 09:10:23 -0400
Local: Sat, Oct 6 2012 9:10 am
Subject: Re: Diff could also show the changes within lines

> Looks like it does not work with DVC diff, so it needs to be disabled for
> that:

If you describe the problem, maybe it can be fixed instead.

        Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Oct 7 2012, 10:10 am
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Sun, 7 Oct 2012 14:10:25 +0000 (UTC)
Local: Sun, Oct 7 2012 10:10 am
Subject: Re: Diff could also show the changes within lines
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> > Looks like it does not work with DVC diff, so it needs to be disabled for
> > that:

> If you describe the problem, maybe it can be fixed instead.

It seems dvc-diff calls the diff hooks early, when the diff
buffer is still empty (I guess it's because it starts an external async
process to get the diff ouput), so diff refine cannot find the diff
headers in the buffer.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sebastien Vauban  
View profile  
 More options Nov 10 2012, 3:58 am
Newsgroups: gnu.emacs.help
From: "Sebastien Vauban" <wxhgmqzgw...@spammotel.com>
Date: Sat, 10 Nov 2012 09:58:59 +0100
Local: Sat, Nov 10 2012 3:58 am
Subject: Re: Diff could also show the changes within lines
Hello Tom, Stefan and all,

Tom wrote:
> Tom <adatgyujto <at> gmail.com> writes:

>>     (diff-auto-refine-mode 1)

> Turns out it only refines one hunk (the current) and the others only if you
> use hunk navigation commands (diff-auto-refine-mode does this which is on by
> default in Emacs 24). So to refine all hunks automatically, do this in the
> diff hook:

>   (save-excursion
>     (goto-char (point-min))
>     (while (not (eobp))
>       (diff-hunk-next))))

I'd like to get that feature as well. However, the above code causes me
2 problems:

- only the last hunk is getting refined, both in VC dir's buffer, or when
  reading (with Gnus) an email with a patch file in it;

- occasionally, an error message "no hunk found" when reading an email with a
  patch file in it.

I patched your code to try and avoid those problems, by:

- adding a condition-case nil... error construct
- using save-excursion
- using an explicit goto-char min
- ...

Here is my current code:

--8<---------------cut here---------------start------------->8---
  ;; enable Diff Auto Refine mode (highlight the changes with better
  ;; granularity)
  (add-hook 'diff-mode-hook
            (lambda ()
              ;; refine all hunks automatically
              (when (>= (diff-end-of-hunk) 1)
                ;; avoid "No hunk found" error
                (goto-char (point-min))
                (while (not (eobp))
                  (diff-hunk-next)))
              (goto-char (point-min))))
--8<---------------cut here---------------end--------------->8---

... but that does not help...

I still have the two above mentioned problems...

Any idea?

Best regards,
  Seb

--
Sebastien Vauban


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Nov 10 2012, 10:30 am
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Sat, 10 Nov 2012 15:30:04 +0000 (UTC)
Local: Sat, Nov 10 2012 10:30 am
Subject: Re: Diff could also show the changes within lines

Sebastien Vauban <wxhgmqzgwmuf@...> writes:

> I'd like to get that feature as well. However, the above code causes me
> 2 problems:

> - only the last hunk is getting refined, both in VC dir's buffer, or when
>   reading (with Gnus) an email with a patch file in it;

Currently I use this code added to the diff mode hook:

(defun my-refine-all-diff-hunks ()
  (interactive)
  (condition-case nil      
      (save-excursion
        (goto-char (point-min))
        (while (not (eobp))
          (diff-hunk-next)))
    (error nil)))

It works well for me, it highlights the changes in all hunks
automatically. I use it only for diffing before checkin.

But. It works only because the VC mercurial implementation calls
the backend synchronously. In case of DVC it doesn't work for
me, because DVC calls the backend asynchronously, so when the diff
hook is run the output is not there yet and I did not find a hook
which is called when the async diff command is finished

You may want to check how the diff output is produced in your use
cases. If it is done asynchronously then the diff hook is not a
suitable place to call the highlighting code from.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oleksandr Gavenko  
View profile  
 More options Nov 12 2012, 3:00 pm
Newsgroups: gnu.emacs.help
From: Oleksandr Gavenko <gaven...@gmail.com>
Date: Mon, 12 Nov 2012 22:00:06 +0200
Local: Mon, Nov 12 2012 3:00 pm
Subject: Re: Diff could also show the changes within lines

On 2012-11-10, Tom wrote:
> Currently I use this code added to the diff mode hook:

> (defun my-refine-all-diff-hunks ()
>   (interactive)
>   (condition-case nil
>       (save-excursion
>         (goto-char (point-min))
>         (while (not (eobp))
>           (diff-hunk-next)))
>     (error nil)))

> It works well for me, it highlights the changes in all hunks
> automatically. I use it only for diffing before checkin.

I found that with code (more precisely 'diff-refine-hunk') hung up Emacs on
large chunks (10-20 KiB).

So I just use "C-c C-b" instead when I need refine-hunk.

--
Best regards!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Nov 13 2012, 3:46 am
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Tue, 13 Nov 2012 08:45:51 +0000 (UTC)
Local: Tues, Nov 13 2012 3:45 am
Subject: Re: Diff could also show the changes within lines
Oleksandr Gavenko <gavenkoa <at> gmail.com> writes:

> I found that with code (more precisely 'diff-refine-hunk') hung up Emacs on
> large chunks (10-20 KiB).

> So I just use "C-c C-b" instead when I need refine-hunk.

I should have added that I have an additional check in my
diff hook, which calls the automatic highlighting of hunks
only if the diff is below a certain size, so I have
automatic highlighting for the majority of my diffs which
are small and for the big ones I toggle the highlight manually
if needed.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sebastien Vauban  
View profile  
 More options Nov 14 2012, 9:31 am
Newsgroups: gnu.emacs.help
From: "Sebastien Vauban" <wxhgmqzgw...@spammotel.com>
Date: Wed, 14 Nov 2012 15:31:51 +0100
Local: Wed, Nov 14 2012 9:31 am
Subject: Re: Diff could also show the changes within lines
Hi Tom,

I'm not sure how to check for that, but I could reduce all my `.emacs' file to
an example file which shows the problem on the current development snapshot of
the future Emacs 24.3 (from 2012-10-22):

--8<---------------cut here---------------start------------->8---
;;; emacs-minimal.el

(setenv "LC_ALL" "C")

;; enable Diff Auto Refine mode (highlight the changes with better
;; granularity)
(defun my/diff-refine-all-hunks ()
  (interactive)
  (condition-case nil
      (save-excursion
        (goto-char (point-min))
        (while (not (eobp))
          (diff-hunk-next)))
    (error nil)))

(add-hook 'diff-mode-hook
          'my/diff-refine-all-hunks)

(message "%s" (emacs-version))
(sit-for 1)
--8<---------------cut here---------------end--------------->8---

You can see, in the screencast on http://screencast.com/t/JOlsyWHh, that:

- the cursor goes to the end of the diff

- only the last diff is refined (see the string " for Diff" which should be
  highlighted in the first hunk)

Best regards,
  Seb

--
Sebastien Vauban


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Nov 14 2012, 1:03 pm
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Wed, 14 Nov 2012 18:03:21 +0000 (UTC)
Local: Wed, Nov 14 2012 1:03 pm
Subject: Re: Diff could also show the changes within lines

Sebastien Vauban <wxhgmqzgwmuf@...> writes:

> You can see, in the screencast on http://screencast.com/t/JOlsyWHh, that:

> - the cursor goes to the end of the diff

> - only the last diff is refined (see the string " for Diff" which should be
>   highlighted in the first hunk)

Try it manually. Go to the diff buffer and call M-x my/diff-refine-all-hunks
there.

Does it highlight all the hunks then?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sebastien Vauban  
View profile  
 More options Nov 14 2012, 5:07 pm
Newsgroups: gnu.emacs.help
From: "Sebastien Vauban" <wxhgmqzgw...@spammotel.com>
Date: Wed, 14 Nov 2012 23:07:28 +0100
Local: Wed, Nov 14 2012 5:07 pm
Subject: Re: Diff could also show the changes within lines
Hi Tom,

Tom wrote:
> Sebastien Vauban <wxhgmqzgwmuf@...> writes:

>> You can see, in the screencast on http://screencast.com/t/JOlsyWHh, that:

>> - the cursor goes to the end of the diff

>> - only the last diff is refined (see the string " for Diff" which should be
>>   highlighted in the first hunk)

> Try it manually. Go to the diff buffer and call M-x my/diff-refine-all-hunks
> there.

> Does it highlight all the hunks then?

No, it doesn't, as you can see on http://screencast.com/t/5NHwKwF7c9h.

What does that mean, then -- excepting that it looks coherent with what is put
in the hook?

Best regards,
Seb

--
Sebastien Vauban


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Nov 15 2012, 1:37 am
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Thu, 15 Nov 2012 06:36:45 +0000 (UTC)
Local: Thurs, Nov 15 2012 1:36 am
Subject: Re: Diff could also show the changes within lines

Sebastien Vauban <wxhgmqzgwmuf@...> writes:

> > Does it highlight all the hunks then?

> No, it doesn't, as you can see on http://screencast.com/t/5NHwKwF7c9h.

> What does that mean, then -- excepting that it looks coherent with what is put
> in the hook?

The diff highlighting function simply calls a builtin feature repeatedly:

        (goto-char (point-min))
        (while (not (eobp))
          (diff-hunk-next)))

diff-hunk-next is bound to TAB, so you can try going to the diff
buffer, go to the beginning of the buffer and start pressing TAB.

Every TAB press should jump to the next hunk and highlight the
diffs within lines in that hunk. It is done by default.

Here's the relevant code from diff-mode.el:

;; Define diff-{hunk,file}-{prev,next}
(easy-mmode-define-navigation
 diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view
 (if diff-auto-refine-mode
     (condition-case-unless-debug nil (diff-refine-hunk) (error nil))))

The last two lines show that if diff-auto-refine-mode is t
(which is by default) then it should do the highlighting.
If it doesn't the you may want to ask the emacs developers about it.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sebastien Vauban  
View profile  
 More options Nov 15 2012, 5:04 am
Newsgroups: gnu.emacs.help
From: "Sebastien Vauban" <wxhgmqzgw...@spammotel.com>
Date: Thu, 15 Nov 2012 11:04:52 +0100
Local: Thurs, Nov 15 2012 5:04 am
Subject: Re: Diff could also show the changes within lines
Hi Tom,

Going to the beginning of the diff buffer and hitting TAB, does indeed moves
over every hunk, in turn, and refines the differences at the same time.

> Here's the relevant code from diff-mode.el:

> ;; Define diff-{hunk,file}-{prev,next}
> (easy-mmode-define-navigation
>  diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view
>  (if diff-auto-refine-mode
>      (condition-case-unless-debug nil (diff-refine-hunk) (error nil))))

> The last two lines show that if diff-auto-refine-mode is t (which is by
> default) then it should do the highlighting. If it doesn't the you may want
> to ask the emacs developers about it.

The variable diff-auto-refine-mode is as well t on my side. But... that does
not help.

BTW, how do you explain that your cursor is not at the end of the buffer, in
your case, after the refine process?

Best regards,
Seb

--
Sebastien Vauban


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Nov 15 2012, 5:15 am
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Thu, 15 Nov 2012 10:15:36 +0000 (UTC)
Local: Thurs, Nov 15 2012 5:15 am
Subject: Re: Diff could also show the changes within lines

Sebastien Vauban <wxhgmqzgwmuf@...> writes:

> Going to the beginning of the diff buffer and hitting TAB, does indeed moves
> over every hunk, in turn, and refines the differences at the same time.

My function does the same, so I can't explain why it
does not work for you when you call it from M-x.

I guess you also use Emacs 24, so it's not about an old emacs version
behaving differently.

> BTW, how do you explain that your cursor is not at the end of the buffer, in
> your case, after the refine process?

I use save-excursion in the function which puts the cursor back to
where it was before the function was called.

I don't know why it is at the end of the buffer for you. There are
some emacs gurus on this list. Hopefully some of them will chime in
and helps you to solve this mistery, because I'm out of ideas.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sebastien Vauban  
View profile  
 More options Nov 15 2012, 6:29 am
Newsgroups: gnu.emacs.help
From: "Sebastien Vauban" <wxhgmqzgw...@spammotel.com>
Date: Thu, 15 Nov 2012 12:29:49 +0100
Local: Thurs, Nov 15 2012 6:29 am
Subject: Re: Diff could also show the changes within lines

Tom wrote:
> Sebastien Vauban <wxhgmqzgwmuf@...> writes:

>> Going to the beginning of the diff buffer and hitting TAB, does indeed
>> moves over every hunk, in turn, and refines the differences at the same
>> time.

> My function does the same, so I can't explain why it does not work for you
> when you call it from M-x.

That's very weird, indeed.

> I guess you also use Emacs 24, so it's not about an old emacs version
> behaving differently.

Yep, sort of future Emacs 24.3, that is:

GNU Emacs 24.2.50.1 (i386-mingw-nt5.1.2600) of 2012-10-22 on DANI-PC

>> BTW, how do you explain that your cursor is not at the end of the buffer,
>> in your case, after the refine process?

> I use save-excursion in the function which puts the cursor back to where it
> was before the function was called.

I had overlooked it. Of course.

> I don't know why it is at the end of the buffer for you. There are some
> emacs gurus on this list. Hopefully some of them will chime in and helps you
> to solve this mistery, because I'm out of ideas.

Thanks for your help so far...

Last thing: can you post your complete chunk of code regarding this? I mean
with your additional check which calls the automatic highlighting of hunks
only if the diff is below a certain size? Thanks a lot...

Best regards,
  Seb

--
Sebastien Vauban


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Nov 15 2012, 7:31 am
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Thu, 15 Nov 2012 12:30:49 +0000 (UTC)
Local: Thurs, Nov 15 2012 7:30 am
Subject: Re: Diff could also show the changes within lines

Sebastien Vauban <wxhgmqzgwmuf@...> writes:

> Last thing: can you post your complete chunk of code regarding this? I mean
> with your additional check which calls the automatic highlighting of hunks
> only if the diff is below a certain size? Thanks a lot...

It's quite straightforward:

(add-hook 'diff-mode-hook 'my-diff-stuff)

(defun my-diff-stuff ()
  (unless (or (eq this-command 'dvc-diff) ; does not work with DVC
              (eq this-command 'dvc-generic-refresh)
              (> (buffer-size) 20000))
    (my-refine-all-diff-hunks)))

(defun my-refine-all-diff-hunks ()
  (interactive)
  (condition-case nil      
      (save-excursion
        (goto-char (point-min))
        (while (not (eobp))
          (diff-hunk-next)))
    (error nil)))


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sebastien Vauban  
View profile  
 More options Nov 15 2012, 10:20 am
Newsgroups: gnu.emacs.help
From: "Sebastien Vauban" <wxhgmqzgw...@spammotel.com>
Date: Thu, 15 Nov 2012 16:20:18 +0100
Local: Thurs, Nov 15 2012 10:20 am
Subject: Re: Diff could also show the changes within lines

FYI, have a look at http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12894.

Best regards,
  Seb

--
Sebastien Vauban


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Nov 15 2012, 11:33 am
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Thu, 15 Nov 2012 16:32:59 +0000 (UTC)
Local: Thurs, Nov 15 2012 11:32 am
Subject: Re: Diff could also show the changes within lines

Sebastien Vauban <wxhgmqzgwmuf@...> writes:

> FYI, have a look at http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12894.

That explains it. I'm on Emacs 24.1 and it does not have this
scheduling code, so that's why it works for me. I didn't think
they changed this recently.

Anyway, you can try calling diff-refine-hunk explicitly after
diff-hunk-next then:

  (condition-case nil      
      (save-excursion
        (goto-char (point-min))
        (while (not (eobp))
          (diff-hunk-next)
          (diff-refine-hunk)))
    (error nil)))

I can't try it, because I use 24.1, but it may work.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sebastien Vauban  
View profile  
 More options Nov 15 2012, 1:17 pm
Newsgroups: gnu.emacs.help
From: "Sebastien Vauban" <wxhgmqzgw...@spammotel.com>
Date: Thu, 15 Nov 2012 19:17:37 +0100
Local: Thurs, Nov 15 2012 1:17 pm
Subject: Re: Diff could also show the changes within lines
Hi Tom,

I wasn't sure how to adapt the code. Thanks for trying...

And the results of the jury are:
- it works for the refining of *all* hunks
- it does not work wrt the position of the cursor, that is it's at the end of
  the buffer...

Thanks for solving already half of the problem!

Best regards,
  Seb

--
Sebastien Vauban


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 33   Newer >
« Back to Discussions « Newer topic     Older topic »