help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: how to highlight fine differences in Diff mode?


From: Drew Adams
Subject: RE: how to highlight fine differences in Diff mode?
Date: Fri, 6 Jan 2006 17:58:31 -0800

    >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'.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]