From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#1183: 23.0.60; ediff-buffers is broken Date: Sun, 19 Oct 2008 10:32:53 +0200 Message-ID: References: <00a101c92fbf$998d19b0$c2b22382@us.oracle.com> <00eb01c92fd0$1be49cc0$c2b22382@us.oracle.com> <002501c93078$21bf8c60$0200a8c0@us.oracle.com> <20081017130533.3c3070bc@kiferserv> <002a01c9307c$3af9fef0$0200a8c0@us.oracle.com> <004901c93087$2c0345e0$0200a8c0@us.oracle.com> <20081017231731.28a0382f@kiferserv> Reply-To: Eli Zaretskii , 1183@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1224410058 19288 80.91.229.12 (19 Oct 2008 09:54:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Oct 2008 09:54:18 +0000 (UTC) Cc: 1183@emacsbugs.donarmstrong.com, bug-gnu-emacs@gnu.org, kifer@cs.stonybrook.edu, kifer@cs.sunysb.edu To: drew.adams@oracle.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 19 11:51:55 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KrU0Z-0004Md-93 for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Oct 2008 10:51:31 +0200 Original-Received: from localhost ([127.0.0.1]:43250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KrTzU-0002ox-8o for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Oct 2008 04:50:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KrTzB-0002iV-Rw for bug-gnu-emacs@gnu.org; Sun, 19 Oct 2008 04:50:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KrTzA-0002i5-Pj for bug-gnu-emacs@gnu.org; Sun, 19 Oct 2008 04:50:05 -0400 Original-Received: from [199.232.76.173] (port=43563 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KrTzA-0002i1-Lv for bug-gnu-emacs@gnu.org; Sun, 19 Oct 2008 04:50:04 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:59009) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KrTz9-0008R2-Dy for bug-gnu-emacs@gnu.org; Sun, 19 Oct 2008 04:50:03 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9J8o0G1011429; Sun, 19 Oct 2008 01:50:00 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m9J8e5XW009248; Sun, 19 Oct 2008 01:40:05 -0700 X-Loop: don@donarmstrong.com Resent-From: Eli Zaretskii Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 19 Oct 2008 08:40:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1183 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1183-submit@emacsbugs.donarmstrong.com id=B1183.12244051837857 (code B ref 1183); Sun, 19 Oct 2008 08:40:05 +0000 Original-Received: (at 1183) by emacsbugs.donarmstrong.com; 19 Oct 2008 08:33:03 +0000 Original-Received: from mtaout6.012.net.il (mtaout6.012.net.il [84.95.2.16]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9J8WxF6007842 for <1183@emacsbugs.donarmstrong.com>; Sun, 19 Oct 2008 01:33:00 -0700 Original-Received: from HOME-C4E4A596F7 ([77.126.98.197]) by i-mtaout6.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K8Z003Y6955OEN0@i-mtaout6.012.net.il> for 1183@emacsbugs.donarmstrong.com; Sun, 19 Oct 2008 10:34:17 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-CrossAssassin-Score: 2 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sun, 19 Oct 2008 04:50:05 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:21673 Archived-At: 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 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