[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ediff maximum line length?
From: |
Giorgos Keramidas |
Subject: |
Re: ediff maximum line length? |
Date: |
Fri, 11 Feb 2011 13:45:11 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
On Fri, 11 Feb 2011 09:27:26 -0500, Stefan Monnier <address@hidden> wrote:
>> I am looking for something that can compare two files, so that I can
>> launch Emacs as my diff tool, e.g. from Perforce, Subversion, etc. I
>> don't know if diff-mode can compare two files instead of a buffer and
>> its file.
>
> diff-mode is not a replacement for ediff in that it only helps you read
> contextual diffs (i.e. the output of `diff' or other tools that output
> in the same format).
> So, if you do
>
> exec emacs --eval "(diff \"$1\" \"$2\")"
>
> the resulting *diff* buffer will be in diff-mode.
Without fine diff highlighting though. In the pathological case of very
long lines that I find myself often into lately (looking at diffs of
auto-generated code), fine diff highlighting is not only convenient, but
often necessary to spot tiny changes in the middle of a long line of
text that includes command-line options, removed arguments, new options
that replace old ones, etc.
>> Is it possible to use diff-mode for the same sort of comparison?
>
> Yes, see above.
>
>
> Stefan
>
>
> PS: For 3-way "diffs", smerge-mode provides a similar alternative to
> ediff3, and also supports highlighting of fine diffs. And there's
> probably a way to get diff3-style output from `diff', so as to use
> smerge-mode for 2-way comparisons.
That's nice. I can produce a diff3 style patch by running:
diff3 -m -L local -L base -L other \
"my-file" /dev/null "other-file"
Then smerge-mode seems to be able to highlight fine diffs, as long as
there are non-word separators somewhere in the line. It may take a bit
of getting used to, but I'll give it a try. In the meantime, I'll try
to read some ediff source to understand where the fine-diff highlighting
limitation comes from.