all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Eli Zaretskii'" <eliz@gnu.org>, <1183@emacsbugs.donarmstrong.com>
Cc: bug-gnu-emacs@gnu.org, 'Michael Kifer' <kifer@cs.stonybrook.edu>
Subject: bug#1183: 23.0.60; ediff-buffers is broken
Date: Fri, 17 Oct 2008 07:36:33 -0700	[thread overview]
Message-ID: <002901c93065$c1da2920$0200a8c0@us.oracle.com> (raw)
In-Reply-To: <ud4hzmm5l.fsf@gnu.org>

> From: Eli Zaretskii Sent: Friday, October 17, 2008 5:39 AM
> > > > If so, this is expected:
> > > 
> > > Well it certainly isn't expected in Emacs 20, 21, or 22, 
> > > where ediff-buffers works perfectly for these two files.
> > > Why this change for Emacs 23? What's the gain?
> > 
> > Sorry, you are right: Emacs 22 also uses --binary, but 
> > doesn't expose this problem.  So I guess something else is
> > at work here.  I'll look closer when I have time.
> 
> Found the culprit.  It's in ediff-make-temp-file:
> 
>   (let* ( ...
>   	 (coding-system-for-write
> 	  (ediff-with-current-buffer buff
> 	    (if (boundp 'buffer-file-coding-system)
> 		buffer-file-coding-system
> 	      ediff-coding-system-for-write)))
> 
> This let-binds the coding-system with which we will write the two
> buffers to temporary files, to the original encoding of the files read
> into the buffers being compared.  The temporary files are then
> submitted to Diff, and that makes each line compare different because
> of the different EOL format.
> 
> Emacs 22 unconditionally uses ediff-coding-system-for-write here,
> which is set to `no-conversion', so this problem does not happen in
> Emacs 22.
> 
> This change was made in Aug 2007, and Michael Kifer wrote a bit later
> on emacs-devel that using no-conversion was screwing some other
> use-case (I couldn't find the description of that use-case, although
> Michael said it was reported earlier on emacs-devel).
> 
> I could easily fix this particular problem by forcing the EOL
> conversion to -unix, but I think there's a broader issue here, and we
> might as well handle it now.  The issue is this: suppose we have two
> buffers whose text is identical in the internal Emacs representation
> of characters, but whose values of buffer-file-coding-system differ--
> do we want such buffers to compare equal or not?  For example, the
> buffers could contain Latin-2 text, with one buffer coming from a file
> encoded in ISO-8859-2, the other coming from a UTF-8 file.
> 
> The current Ediff code will compare these buffers different.  If we
> want them to compare equal instead, this means that `ediff' and
> `ediff-buffers' will produce different results for the same two files.
> 
> The different EOL format is just a special case of this general
> problem.
> 
> In a discussion in Oct 2007, Stefan said that using the buffer's
> encoding is wrong, see:
> 
>   http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01381.html
> 
> Stefan wanted to use the equivalent of emacs-mule for Emacs 23 instead
> of buffer's encoding, but do we have such an encoding now?  Is
> no-conversion-multibyte it?  Or maybe utf-8 is good enough?
> 
> But first, we should decide whether we want such buffers to compare
> equal or not.
> 
> We could also let them compare equal, but display a message to the
> effect that the buffers define different encoding for saving them to
> files.
> 
> Opinions?

I don't have much of an opinion because of ignorance in this area. If you are
asking whether ediff should treat buffers as different when they differ only by
encoding or line endings, I'd say probably yes and know: It would be good to
give the user all knowledge that ediff has, and then let the user control how to
compare. A message could let the user know about line-ending differences, for
example, and ask if you want to compare using only Emacs's internal encoding (or
whatever the correct terminology is) - that is, ignoring just the line-ending
difference.

IOW, give the user the knowledge and control. What's unacceptable is for Emacs
to throw up its hands and just say the two are different, without saying/showing
how they differ. The user should be able to drill down and see all possible
differences, perhaps showing different kinds of differences in different ways.

I'll leave the rest to you guys who know about this stuff. You get the drift of
what's missing/wrong. Thx.








  reply	other threads:[~2008-10-17 14:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ur66ck3d4.fsf@gnu.org>
2008-10-16 18:47 ` bug#1183: 23.0.60; ediff-buffers is broken Drew Adams
2008-10-16 20:25   ` Eli Zaretskii
2008-10-16 20:45     ` Drew Adams
2008-10-16 21:15       ` Eli Zaretskii
2008-10-16 21:58         ` Drew Adams
2008-10-17 12:38         ` Eli Zaretskii
2008-10-17 14:36           ` Drew Adams [this message]
2008-10-17 16:02           ` Stefan Monnier
2008-10-17 16:48             ` Drew Adams
2008-10-17 17:05               ` Michael Kifer
2008-10-17 17:17                 ` Drew Adams
2008-10-17 18:15                   ` Eli Zaretskii
2008-10-17 18:35                     ` Drew Adams
2008-10-18  3:17                       ` Michael Kifer
2008-10-18  3:43                         ` Drew Adams
2008-10-18  9:07                         ` Eli Zaretskii
2008-10-19  2:17                           ` Stefan Monnier
2008-10-19  7:17                             ` Eli Zaretskii
2008-10-19  7:23                             ` Eli Zaretskii
2008-10-19  8:32                             ` Eli Zaretskii
2008-10-19 15:07                               ` Drew Adams
2008-10-19 15:32                                 ` Eli Zaretskii
2008-10-17 18:19               ` Eli Zaretskii
2008-10-17 18:35                 ` Drew Adams
2008-10-17 18:34             ` Eli Zaretskii
2008-10-19  2:21               ` Stefan Monnier
2008-10-19 15:40   ` bug#1183: marked as done (23.0.60; ediff-buffers is broken) Emacs bug Tracking System

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002901c93065$c1da2920$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=1183@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=eliz@gnu.org \
    --cc=kifer@cs.stonybrook.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.