all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to highlight fine differences in Diff mode?
@ 2005-12-06 20:16 Kevin Rodgers
  2005-12-07 16:19 ` Drew Adams
  0 siblings, 1 reply; 10+ messages in thread
From: Kevin Rodgers @ 2005-12-06 20:16 UTC (permalink / raw)


I love Ediff.  I mean, I really, really love it.

But sometimes I have to compare extremely large files, larger than Emacs
maximum buffer size.  So I simply run diff and redirect its output to a
.diff file, which is easily small enought to visit and navigate in Diff
mode.  What I'd like at that point is a command to highlight the changed
text within the current hunk, just like "*" does in Ediff:

,----[ C-h k * ]
| * runs the command ediff-make-or-kill-fine-diffs
|    which is an interactive compiled Lisp function in `ediff-util'.
| (ediff-make-or-kill-fine-diffs ARG)
|
| Compute fine diffs.  With negative prefix arg, kill fine diffs.
| In both cases, operates on the current difference region.
`----

Is there any way to take advantage of the Ediff machinery inside
Diff mode?

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how to highlight fine differences in Diff mode?
       [not found] <mailman.18178.1133901143.20277.help-gnu-emacs@gnu.org>
@ 2005-12-07  3:45 ` Stefan Monnier
  2005-12-07  7:54   ` Matthieu Moy
  2005-12-08 14:29   ` Alan Mackenzie
  0 siblings, 2 replies; 10+ messages in thread
From: Stefan Monnier @ 2005-12-07  3:45 UTC (permalink / raw)


> Is there any way to take advantage of the Ediff machinery inside
> Diff mode?

Not right now, tho I'd be happy to take a patch for it.
It's been on the TODO list in diff-mode for a while now.
Note that I have recently written some related code for smerge-mode to do
a similar highlighting of refined differences in diff3 conflicts.


        Stefan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how to highlight fine differences in Diff mode?
  2005-12-07  3:45 ` Stefan Monnier
@ 2005-12-07  7:54   ` Matthieu Moy
  2005-12-08 18:58     ` Kevin Rodgers
  2005-12-08 14:29   ` Alan Mackenzie
  1 sibling, 1 reply; 10+ messages in thread
From: Matthieu Moy @ 2005-12-07  7:54 UTC (permalink / raw)


Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Is there any way to take advantage of the Ediff machinery inside
>> Diff mode?
>
> Not right now, tho I'd be happy to take a patch for it.
> It's been on the TODO list in diff-mode for a while now.
> Note that I have recently written some related code for smerge-mode to do
> a similar highlighting of refined differences in diff3 conflicts.

Just my 2 cents: That would be GREAT!

-- 
Matthieu

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: how to highlight fine differences in Diff mode?
  2005-12-06 20:16 how to highlight fine differences in Diff mode? Kevin Rodgers
@ 2005-12-07 16:19 ` Drew Adams
  0 siblings, 0 replies; 10+ messages in thread
From: Drew Adams @ 2005-12-07 16:19 UTC (permalink / raw)


    But sometimes I have to compare extremely large files, larger than Emacs
    maximum buffer size.  So I simply run diff and redirect its output to a
    .diff file, which is easily small enought to visit and navigate in Diff
    mode.  What I'd like at that point is a command to highlight the changed
    text within the current hunk, just like "*" does in Ediff:

    ,----[ C-h k * ]
    | * runs the command ediff-make-or-kill-fine-diffs
    |    which is an interactive compiled Lisp function in `ediff-util'.
    | (ediff-make-or-kill-fine-diffs ARG)
    |
    | Compute fine diffs.  With negative prefix arg, kill fine diffs.
    | In both cases, operates on the current difference region.
    `----

    Is there any way to take advantage of the Ediff machinery inside
    Diff mode?

I don't have an answer for you, unfortunately. I do have some code that
improves the highlighting of regular `diff' output slightly:
http://www.emacswiki.org/cgi-bin/wiki/diff-mode-.el, but it doesn't do what
you're asking.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how to highlight fine differences in Diff mode?
  2005-12-07  3:45 ` Stefan Monnier
  2005-12-07  7:54   ` Matthieu Moy
@ 2005-12-08 14:29   ` Alan Mackenzie
  1 sibling, 0 replies; 10+ messages in thread
From: Alan Mackenzie @ 2005-12-08 14:29 UTC (permalink / raw)


Stefan Monnier <monnier@iro.umontreal.ca> wrote on Tue, 06 Dec 2005
22:45:17 -0500:
>> Is there any way to take advantage of the Ediff machinery inside Diff
>> mode?

> Not right now, tho I'd be happy to take a patch for it.  It's been on
> the TODO list in diff-mode for a while now.  Note that I have recently
> written some related code for smerge-mode to do a similar highlighting
> of refined differences in diff3 conflicts.

FWIW, Diff Mode is right up at the top of my list of favourite modes.

It has been my standard answer to colleagues who sometimes ask "what's so
good about Emacs?".  I just put up a file.diff, and let the goggle over
the fontification - then I show them navigation with n, p, M-{, and M=},
which increases their interest, and finally I show them C-c C-c and C-c
C-a.  It gets them interested.  :-)

>         Stefan

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how to highlight fine differences in Diff mode?
  2005-12-07  7:54   ` Matthieu Moy
@ 2005-12-08 18:58     ` Kevin Rodgers
  0 siblings, 0 replies; 10+ messages in thread
From: Kevin Rodgers @ 2005-12-08 18:58 UTC (permalink / raw)


Matthieu Moy wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>>Is there any way to take advantage of the Ediff machinery inside
>>>Diff mode?
>>
>>Not right now, tho I'd be happy to take a patch for it.
>>It's been on the TODO list in diff-mode for a while now.
>>Note that I have recently written some related code for smerge-mode to do
>>a similar highlighting of refined differences in diff3 conflicts.
> 
> Just my 2 cents: That would be GREAT!

Just to let everyone know, I'm making pretty good progress.  I'll
post as soon as I've got something useful.

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how to highlight fine differences in Diff mode?
       [not found] <mailman.18320.1133972403.20277.help-gnu-emacs@gnu.org>
@ 2006-01-07  1:38 ` David Combs
  2006-01-07  1:58   ` Drew Adams
  0 siblings, 1 reply; 10+ messages in thread
From: David Combs @ 2006-01-07  1:38 UTC (permalink / raw)


In article <mailman.18320.1133972403.20277.help-gnu-emacs@gnu.org>,
Drew Adams <drew.adams@oracle.com> wrote:
>    But sometimes I have to compare extremely large files, larger than Emacs
>    maximum buffer size.  So I simply run diff and redirect its output to a
>    .diff file, which is easily small enought to visit and navigate in Diff
>    mode.  What I'd like at that point is a command to highlight the changed
>    text within the current hunk, just like "*" does in Ediff:
>
>    ,----[ C-h k * ]
>    | * runs the command ediff-make-or-kill-fine-diffs
>    |    which is an interactive compiled Lisp function in `ediff-util'.
>    | (ediff-make-or-kill-fine-diffs ARG)
>    |
>    | Compute fine diffs.  With negative prefix arg, kill fine diffs.
>    | In both cases, operates on the current difference region.
>    `----
>
>    Is there any way to take advantage of the Ediff machinery inside
>    Diff mode?
>
>I don't have an answer for you, unfortunately. I do have some code that
>improves the highlighting of regular `diff' output slightly:
>http://www.emacswiki.org/cgi-bin/wiki/diff-mode-.el, but it doesn't do what
>you're asking.
>
>
>

1: "diff-mode": never heard of it.  Yes, there is one in the lisp
   subdirectory, at least of 22.0.50.1 (old) cvs.

2: So, I suppose the diff-mode.el in the wiki, vs the one that
   comes "in the box", have no relation to each other.  (Well,
   at least the on in the lisp dir says nothing about "drew adams".)

3: not seeing much doc in the built-in one (or in info, either),
   what does diff-mode enable me to do (easily) that ediff-mode
   doesn't?

4: In fact, are the two packages (for lack of better word)
   based on different concepts of what a "diff in emacs"
   should do?

5: Here's the tail end of the info-node "comparing files":


   Differences between versions of files are often distributed as
"patches", which are the output from `diff' or a version control system
that uses `diff'.  `M-x diff-mode' turns on Diff mode, a major mode for
viewing and editing patches, either as "unified diffs" or "context
diffs."

   You can use `M-x smerge-mode' to turn on Smerge mode, a minor mode
for editing output from the `diff3' program.  This is typically the
result of a failed merge from a version control system "update" outside
VC, due to conflicting changes to a file.  Smerge mode provides
commands to resolve conflicts by selecting specific changes.

   See also *Note Emerge::, and *Note Top: (ediff)Top, for convenient
facilities for merging two similar files.



Sure doesn't say much about diff-mode -- and suggests looking
at ediff ONLY IF YOU NEED TO *MERGE* FILES.

Methinks ediff has more uses than that????   

David

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: how to highlight fine differences in Diff mode?
  2006-01-07  1:38 ` David Combs
@ 2006-01-07  1:58   ` Drew Adams
  0 siblings, 0 replies; 10+ messages in thread
From: Drew Adams @ 2006-01-07  1:58 UTC (permalink / raw)


    >I don't have an answer for you, unfortunately. I do have some code that
    >improves the highlighting of regular `diff' output slightly:
    >http://www.emacswiki.org/cgi-bin/wiki/diff-mode-.el, but it
    >doesn't do what you're asking.

    1: "diff-mode": never heard of it.  Yes, there is one in the lisp
       subdirectory, at least of 22.0.50.1 (old) cvs.

The library I mentioned was diff-mode-.el, not diff-mode.el. The former is a
minor enhancement to the latter. The latter has recently been updated in
CVS, and is now very similar to the former. If you are using CVS Emacs, you
can use just the latter. If you are using Emacs 21, you might want to use
both.

In any case, as I said, this does not respond directly to your question.

    2: So, I suppose the diff-mode.el in the wiki, vs the one that
       comes "in the box", have no relation to each other.  (Well,
       at least the on in the lisp dir says nothing about "drew adams".)

See above. I think the confusion is because of the similarity in library
names. I use a + or - after a standard library name when I write a library
that tweaks a standardard library. Sorry about the confusion.

    3: not seeing much doc in the built-in one (or in info, either),
       what does diff-mode enable me to do (easily) that ediff-mode
       doesn't?

Diff-mode highlights an existing `diff' buffer, regardless of its source.
Ediff runs `diff' and then formats the result in a particularly useful way.
Ediff works on buffers, not just files.

If you just want to compare two buffers, use `ediff'.

    4: In fact, are the two packages (for lack of better word)
       based on different concepts of what a "diff in emacs"
       should do?

Yes. It's harder to describe than to see - just try using `diff' on two
files and then using `ediff' on them.

    5: Here's the tail end of the info-node "comparing files":

       Differences between versions of files are often distributed as
    "patches", which are the output from `diff' or a version control system
    that uses `diff'.  `M-x diff-mode' turns on Diff mode, a major mode for
    viewing and editing patches, either as "unified diffs" or "context
    diffs."

       You can use `M-x smerge-mode' to turn on Smerge mode, a minor mode
    for editing output from the `diff3' program.  This is typically the
    result of a failed merge from a version control system "update" outside
    VC, due to conflicting changes to a file.  Smerge mode provides
    commands to resolve conflicts by selecting specific changes.

       See also *Note Emerge::, and *Note Top: (ediff)Top, for convenient
    facilities for merging two similar files.


    Sure doesn't say much about diff-mode -- and suggests looking
    at ediff ONLY IF YOU NEED TO *MERGE* FILES.

    Methinks ediff has more uses than that????

Yes, `ediff' is very useful. `diff-mode' just provides highlighting for the
output from `diff'. If someone gives you `diff' output (e.g. a patch), then
you can browse (and even edit) it while it is highlighted by `diff-mode'.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how to highlight fine differences in Diff mode?
       [not found] <mailman.217.1136599234.26925.help-gnu-emacs@gnu.org>
@ 2006-01-11  1:59 ` David Combs
  2006-01-11  3:09   ` Drew Adams
  0 siblings, 1 reply; 10+ messages in thread
From: David Combs @ 2006-01-11  1:59 UTC (permalink / raw)


In article <mailman.217.1136599234.26925.help-gnu-emacs@gnu.org>,
Drew Adams <drew.adams@oracle.com> wrote:
>    >I don't have an answer for you, unfortunately. I do have some code that
>    >improves the highlighting of regular `diff' output slightly:
>    >http://www.emacswiki.org/cgi-bin/wiki/diff-mode-.el, but it
>    >doesn't do what you're asking.
>
>    1: "diff-mode": never heard of it.  Yes, there is one in the lisp
>       subdirectory, at least of 22.0.50.1 (old) cvs.
>
>The library I mentioned was diff-mode-.el, not diff-mode.el. The former is a
>minor enhancement to the latter. The latter has recently been updated in
>CVS, and is now very similar to the former. If you are using CVS Emacs, you
>can use just the latter. If you are using Emacs 21, you might want to use
>both.
>
...


Thanks so much for the explanation!  Makes it all clear.

Maybe edit that (excellent) explanation into the file (if it's
  not already there -- haven't yet grabbed diff-mode-.el).

Thanks!

David

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: how to highlight fine differences in Diff mode?
  2006-01-11  1:59 ` David Combs
@ 2006-01-11  3:09   ` Drew Adams
  0 siblings, 0 replies; 10+ messages in thread
From: Drew Adams @ 2006-01-11  3:09 UTC (permalink / raw)


    > The library I mentioned was diff-mode-.el, not diff-mode.el.
    > The former is a minor enhancement to the latter. The latter
    > has recently been updated in CVS, and is now very similar to
    > the former. If you are using CVS Emacs, you can use just the
    > latter. If you are using Emacs 21, you might want to use
    > both.

    Thanks so much for the explanation!  Makes it all clear.

    Maybe edit that (excellent) explanation into the file (if it's
    not already there -- haven't yet grabbed diff-mode-.el).

Yes, there is such an explanation in the file.

There is also a more general explanation here:
http://www.emacswiki.org/cgi-bin/wiki/DrewsElispLibraries#LibraryNames.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-01-11  3:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-06 20:16 how to highlight fine differences in Diff mode? Kevin Rodgers
2005-12-07 16:19 ` Drew Adams
     [not found] <mailman.18178.1133901143.20277.help-gnu-emacs@gnu.org>
2005-12-07  3:45 ` Stefan Monnier
2005-12-07  7:54   ` Matthieu Moy
2005-12-08 18:58     ` Kevin Rodgers
2005-12-08 14:29   ` Alan Mackenzie
     [not found] <mailman.18320.1133972403.20277.help-gnu-emacs@gnu.org>
2006-01-07  1:38 ` David Combs
2006-01-07  1:58   ` Drew Adams
     [not found] <mailman.217.1136599234.26925.help-gnu-emacs@gnu.org>
2006-01-11  1:59 ` David Combs
2006-01-11  3:09   ` Drew Adams

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.