all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ediff customization: -w -B... + refinement
@ 2006-10-04 13:26 Peter Tury
  2006-10-04 15:49 ` Kevin Rodgers
       [not found] ` <mailman.7727.1159977183.9609.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Tury @ 2006-10-04 13:26 UTC (permalink / raw)


Hi,

I see different results in Emacs ediff and out-of-emacs command line
diff.

I try to get rid of white space and new line diffs, so I tried diff -a
-w -B --binary ... It produces the desired output in command line, but
whitespace- and newline-differences are showed (and treated) in
Emacs. Why? I set ediff-diff-options to "-a -w -B --binary", but it
seems to be ignored? Why? How to get rid of such whitespace diffs? I
tried ##, but nothing changed.

How can check what command was exactly sent by Emacs (to
Windows/diff)? (If I check *ediff-diff*'s content, it is "wrong",
i.e. shows result without -w -B...) And what diff is used? (I have an old
diff also in my path, but I put the directory of the new diff before
that old one's directory in the path variable.)

My other question: what to do if I want refinement to show differences
by chars and not by words?

These makes ediff unusable for me now, because emacs shows totally
wrong lines compared. E.g. if an empty line is deleted and following
lines are reindented then I see (in ediff's windows) as if the
(original) empty line would have been replaced with several new lines
(what are in fact only reindented) and then the original lines are
compared with other lines... :-( I think this is diff's feature, but
can be handled in command line with switches -w -B -- but not in
Emacs?

What am I doing wrong?

I try to use ediff (on MS Windows XP, EmacsW32 patched, v2006 May
01). I installed latest GnuWin32's diff (2.8.7), it is in my path.

Thanks in advance,
P

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

* Re: ediff customization: -w -B... + refinement
  2006-10-04 13:26 ediff customization: -w -B... + refinement Peter Tury
@ 2006-10-04 15:49 ` Kevin Rodgers
       [not found] ` <mailman.7727.1159977183.9609.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2006-10-04 15:49 UTC (permalink / raw)


Peter Tury wrote:
> I see different results in Emacs ediff and out-of-emacs command line
> diff.
> 
> I try to get rid of white space and new line diffs, so I tried diff -a
> -w -B --binary ... It produces the desired output in command line, but
> whitespace- and newline-differences are showed (and treated) in
> Emacs. Why? I set ediff-diff-options to "-a -w -B --binary", but it
> seems to be ignored? Why? How to get rid of such whitespace diffs? I
> tried ##, but nothing changed.
> 
> How can check what command was exactly sent by Emacs (to
> Windows/diff)? (If I check *ediff-diff*'s content, it is "wrong",
> i.e. shows result without -w -B...) And what diff is used? (I have an old
> diff also in my path, but I put the directory of the new diff before
> that old one's directory in the path variable.)

To see what diff program is used:

M-: (executable-find ediff-diff-program)

I don't think you can find out after the fact what command was run,
but you could see which options are used dynamically by examining the
4th argument passed to ediff-exec-process:

M-x debug-on-entry RET ediff-exec-process

Looking at its source code in ediff-diff.el, I find:

     ;; the --binary option, if present, should be used only for buffer jobs
     ;; or for refining the differences
     (or (string-match "buffer" (symbol-name ediff-job-name))
	(eq buffer ediff-fine-diff-buffer)
	(setq args (delete "--binary" args)))

So maybe you need to use M-x ediff-buffers instead of M-x ediff-files
to use the --binary option.

> My other question: what to do if I want refinement to show differences
> by chars and not by words?

Try: (setq ediff-forward-word-function 'forward-char)

> These makes ediff unusable for me now, because emacs shows totally
> wrong lines compared. E.g. if an empty line is deleted and following
> lines are reindented then I see (in ediff's windows) as if the
> (original) empty line would have been replaced with several new lines
> (what are in fact only reindented) and then the original lines are
> compared with other lines... :-( I think this is diff's feature, but
> can be handled in command line with switches -w -B -- but not in
> Emacs?

-- 
Kevin

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

* Re: ediff customization: -w -B... + refinement
       [not found] ` <mailman.7727.1159977183.9609.help-gnu-emacs@gnu.org>
@ 2006-10-04 22:14   ` tury.peter
  2006-10-05  6:58     ` Peter Tury
  2006-10-05 15:35     ` Kevin Rodgers
  0 siblings, 2 replies; 5+ messages in thread
From: tury.peter @ 2006-10-04 22:14 UTC (permalink / raw)


Hi,

thanks for your hints!

Kevin Rodgers wrote:
> Peter Tury wrote:
> > I see different results in Emacs ediff and out-of-emacs command line
> > diff.
> >
> > I try to get rid of white space and new line diffs, so I tried diff -a
> > -w -B --binary ... It produces the desired output in command line, but
> > whitespace- and newline-differences are showed (and treated) in
> > Emacs. Why? I set ediff-diff-options to "-a -w -B --binary", but it
> > seems to be ignored? Why? How to get rid of such whitespace diffs? I
> > tried ##, but nothing changed.
> >
> To see what diff program is used:
>
> M-: (executable-find ediff-diff-program)

Thanks, now I checked it: it's OK.

> I don't think you can find out after the fact what command was run,
> but you could see which options are used dynamically by examining the
> 4th argument passed to ediff-exec-process:
>
> M-x debug-on-entry RET ediff-exec-process

I checked this also now, thanks for the hint, but found nothing
interesting.

> Looking at its source code in ediff-diff.el, I find:
>
>      ;; the --binary option, if present, should be used only for buffer jobs
>      ;; or for refining the differences
>      (or (string-match "buffer" (symbol-name ediff-job-name))
> 	(eq buffer ediff-fine-diff-buffer)
> 	(setq args (delete "--binary" args)))
>
> So maybe you need to use M-x ediff-buffers instead of M-x ediff-files
> to use the --binary option.

Now I find that opening two files and ediff-buffers and ediff-files
them, shows different results!? Maybe because of this --binary stuff?
For first sight ediff-buffers seems to be OK. Maybe some file encoding
makes the difference?

>
> > My other question: what to do if I want refinement to show differences
> > by chars and not by words?
>
> Try: (setq ediff-forward-word-function 'forward-char)

I couldn't: with M-: it became buffer-local, and didn't affect the
result :-((

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

* Re: ediff customization: -w -B... + refinement
  2006-10-04 22:14   ` tury.peter
@ 2006-10-05  6:58     ` Peter Tury
  2006-10-05 15:35     ` Kevin Rodgers
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Tury @ 2006-10-05  6:58 UTC (permalink / raw)


Correction:

tury.peter@gmail.com writes:

> Now I find that opening two files and ediff-buffers and ediff-files
> them, shows different results!? Maybe because of this --binary stuff?
> For first sight ediff-buffers seems to be OK. Maybe some file encoding
> makes the difference?

This was true on my home PC what has (almost) latest EmacsW32. On my
work laptop (with May 1 version of EmacsW32) both ediff-buffers and
ediff-files shows bed results. Maybe this whole problem is related to
end-of-line handling in EmacsW32?

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

* Re: ediff customization: -w -B... + refinement
  2006-10-04 22:14   ` tury.peter
  2006-10-05  6:58     ` Peter Tury
@ 2006-10-05 15:35     ` Kevin Rodgers
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2006-10-05 15:35 UTC (permalink / raw)


tury.peter@gmail.com wrote:
> Hi,
> 
> thanks for your hints!
> 
> Kevin Rodgers wrote:
>> Peter Tury wrote:
...
>>> My other question: what to do if I want refinement to show differences
>>> by chars and not by words?
>> Try: (setq ediff-forward-word-function 'forward-char)
> 
> I couldn't: with M-: it became buffer-local, and didn't affect the
> result :-((

Ah, use setq-default (instead of setq) to set the global value.

-- 
Kevin

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

end of thread, other threads:[~2006-10-05 15:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-04 13:26 ediff customization: -w -B... + refinement Peter Tury
2006-10-04 15:49 ` Kevin Rodgers
     [not found] ` <mailman.7727.1159977183.9609.help-gnu-emacs@gnu.org>
2006-10-04 22:14   ` tury.peter
2006-10-05  6:58     ` Peter Tury
2006-10-05 15:35     ` Kevin Rodgers

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.