unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: drew.adams@oracle.com
Cc: 1183@emacsbugs.donarmstrong.com, bug-gnu-emacs@gnu.org,
	kifer@cs.stonybrook.edu, kifer@cs.sunysb.edu
Subject: bug#1183: 23.0.60; ediff-buffers is broken
Date: Sun, 19 Oct 2008 10:32:53 +0200	[thread overview]
Message-ID: <u3aitkmru.fsf@gnu.org> (raw)
In-Reply-To: <jwvskqtz64b.fsf-monnier+emacsbugreports@gnu.org>

Drew, please see if the patch below fixes the problem for you.

If you are not using a very recent CVS code, you will probably need to
use utf-8-emacs-unix instead of emacs-internal in the ediff-init.el
change, because emacs-internal was only introduced yesterday.

Michael, could you please add a warning message in buffer jobs about
differences in the values of buffer-file-coding-system between the
buffers being compared?  In particular, if there are no differences in
a region, but the above values are different, it would be good if
Ediff would say something like "only character-encoding differences"
instead of "only white-space differences".

Thanks.

2008-10-19  Eli Zaretskii  <eliz@gnu.org>

	Fix Bug #1183:

	* ediff-diff.el (ediff-exec-process): For buffer jobs, bind
	coding-system-for-read to ediff-coding-system-for-write.

	* ediff-util.el (ediff-make-temp-file): Unconditionally bind
	coding-system-for-write to ediff-coding-system-for-write.

	* ediff-init.el (ediff-coding-system-for-read): Doc fix.
	(ediff-coding-system-for-write): Set to emacs-internal.


Index: lisp/ediff-init.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ediff-init.el,v
retrieving revision 1.93
diff -u -r1.93 ediff-init.el
--- lisp/ediff-init.el	31 Jul 2008 05:33:43 -0000	1.93
+++ lisp/ediff-init.el	19 Oct 2008 08:20:30 -0000
@@ -719,17 +719,17 @@
 
 (defcustom ediff-coding-system-for-read 'raw-text
   "*The coding system for read to use when running the diff program as a subprocess.
-In most cases, the default will do. However, under certain circumstances in
-Windows NT/98/95 you might need to use something like 'raw-text-dos here.
+In most cases, the default will do.  However, under certain circumstances in
+MS-Windows you might need to use something like 'raw-text-dos here.
 So, if the output that your diff program sends to Emacs contains extra ^M's,
 you might need to experiment here, if the default or 'raw-text-dos doesn't
 work."
   :type 'symbol
   :group 'ediff)
 
-(defcustom ediff-coding-system-for-write 'no-conversion
+(defcustom ediff-coding-system-for-write 'emacs-internal
   "*The coding system for write to use when writing out difference regions
-to temp files when Ediff needs to find fine differences."
+to temp files in buffer jobs and when Ediff needs to find fine differences."
   :type 'symbol
   :group 'ediff)
 
Index: lisp/ediff-util.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ediff-util.el,v
retrieving revision 1.93
diff -u -r1.93 ediff-util.el
--- lisp/ediff-util.el	31 Jul 2008 05:33:43 -0000	1.93
+++ lisp/ediff-util.el	19 Oct 2008 08:20:55 -0000
@@ -3146,11 +3146,7 @@
 (defun ediff-make-temp-file (buff &optional prefix given-file start end)
   (let* ((p (ediff-convert-standard-filename (or prefix "ediff")))
 	 (short-p p)
-	 (coding-system-for-write
-	  (ediff-with-current-buffer buff
-	    (if (boundp 'buffer-file-coding-system)
-		buffer-file-coding-system
-	      ediff-coding-system-for-write)))
+	 (coding-system-for-write ediff-coding-system-for-write)
 	 f short-f)
     (if (and (fboundp 'msdos-long-file-names)
 	     (not (msdos-long-file-names))
Index: lisp/ediff-diff.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ediff-diff.el,v
retrieving revision 1.72
diff -u -r1.72 ediff-diff.el
--- lisp/ediff-diff.el	31 Jul 2008 05:33:42 -0000	1.72
+++ lisp/ediff-diff.el	19 Oct 2008 08:21:10 -0000
@@ -1207,7 +1207,13 @@
 ;; args.
 (defun ediff-exec-process (program buffer synch options &rest files)
   (let ((data (match-data))
-	(coding-system-for-read ediff-coding-system-for-read)
+	;; If this is a buffer job, we are diffing temporary files
+	;; produced by Emacs with ediff-coding-system-for-write, so
+	;; use the same encoding to read the results.
+	(coding-system-for-read
+	 (if (string-match "buffer" (symbol-name ediff-job-name))
+	     ediff-coding-system-for-write
+	   ediff-coding-system-for-read))
 	args)
     (setq args (append (split-string options) files))
     (setq args (delete "" (delq nil args))) ; delete nil and "" from arguments






  parent reply	other threads:[~2008-10-19  8:32 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
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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=u3aitkmru.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=1183@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=kifer@cs.stonybrook.edu \
    --cc=kifer@cs.sunysb.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).