help-gnu-emacs
[Top][All Lists]
Advanced

[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 12:55:57 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Kevin Rodgers wrote:

 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?

Here's a better patch, that tries to take into account the fact that
buffer-file-coding-system is buffer local:

*** emacs-21.3/lisp/pcvs.el.orig        Sat Sep 22 14:23:16 2001
--- emacs-21.3/lisp/pcvs.el     Tue Sep  9 12:54:51 2003
***************
*** 1515,1526 ****
  (defun cvs-retrieve-revision (fileinfo rev)
    "Retrieve the given REVision of the file in FILEINFO into a new buffer."
    (let* ((file (cvs-fileinfo->full-path fileinfo))
!        (buffile (concat file "." rev)))
      (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)
--- 1515,1529 ----
  (defun cvs-retrieve-revision (fileinfo rev)
    "Retrieve the given REVision of the file in FILEINFO into a new buffer."
    (let* ((file (cvs-fileinfo->full-path fileinfo))
!        (buffile (concat file "." rev))
!        (cvs-coding-system buffer-file-coding-system))
      (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) cvs-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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]