[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PCL-CVS] Interactive diff on a utf-8 encoded file
From: |
Kevin Rodgers |
Subject: |
Re: [PCL-CVS] Interactive diff on a utf-8 encoded file |
Date: |
Tue, 09 Sep 2003 11:56:08 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
Jérôme Haguet wrote:
Hello
I have
- GNU Emacs 21.3 on Windows
- a CVS checkout in which most of the files are encoded in ISO-8859-1 and
some others in UTF-8.
All the utf-8 encoded files have the .utf extension
I have added in my .emacs the following line :
(add-to-list 'file-coding-system-alist (list "\\.utf" 'utf-8))
prefer-coding-system is set to 'iso-latin-1
Everything works fine when I open a file (Emacs set the right coding system)
My problem is when I run interactive diff from PCL-CVS (d e)
Emacs always set the coding system of the BASE version of the .utf files to
iso-8859-1
From pcvs.el:
;;; Bugs:
;; - Extracting an old version seems not to recognize encoding correctly.
;; That's probably because it's done via a process rather than a file.
> Any idea how to fix this ?
Maybe cvs-retrieve-revision can be hacked. Does this *untested* patch work?
*** emacs-21.3/lisp/pcvs.el.orig Sat Sep 22 14:23:16 2001
--- emacs-21.3/lisp/pcvs.el Tue Sep 9 11:54:55 2003
***************
*** 1519,1526 ****
(or (find-buffer-visiting buffile)
(with-current-buffer (create-file-buffer buffile)
(message "Retrieving revision %s..." rev)
! (let ((res (call-process cvs-program nil t nil
!
"-q" "update" "-p" "-r" rev file)))
(when (and res (not (and (equal 0 res))))
(error "Something went wrong retrieving revision %s: %s" rev res))
(set-buffer-modified-p nil)
--- 1519,1529 ----
(or (find-buffer-visiting buffile)
(with-current-buffer (create-file-buffer buffile)
(message "Retrieving revision %s..." rev)
! (let* ((process-coding-system-alist
! (list (cons (regexp-quote cvs-program)
!
buffer-file-coding-system)))
! (res (call-process cvs-program nil t nil
!
"-q" "update" "-p" "-r" rev file)))
(when (and res (not (and (equal 0 res))))
(error "Something went wrong retrieving revision %s: %s" rev res))
(set-buffer-modified-p nil)
--
Kevin Rodgers