all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* cvs-retrieve-revision ignores the working file's coding system
@ 2003-09-10 22:27 Kevin Rodgers
  0 siblings, 0 replies; only message in thread
From: Kevin Rodgers @ 2003-09-10 22:27 UTC (permalink / raw)


This bug was originally reported and discussed on gnu.emacs.help; see
http://mail.gnu.org/archive/html/help-gnu-emacs/2003-09/msg00163.html

vc.el and vc-cvs.el handle it via vc-coding-system-for-diff, but pcvs.el
doesn't handle it at all.  Here's a patch to use the working file's coding
system when retrieving other versions from the repository:

*** emacs-21.3/lisp/pcvs.el.orig	Sat Sep 22 14:23:16 2001
--- emacs-21.3/lisp/pcvs.el	Wed Sep 10 16:16:37 2003
***************
*** 1517,1534 ****
     (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)
! 	    (let ((buffer-file-name (expand-file-name file)))
! 	      (after-find-file))
! 	    (toggle-read-only 1)
! 	    (message "Retrieving revision %s... Done" rev)
! 	    (current-buffer))))))

   (eval-and-compile (autoload 'smerge-ediff "smerge-mode"))

--- 1517,1546 ----
     (let* ((file (cvs-fileinfo->full-path fileinfo))
   	 (buffile (concat file "." rev)))
       (or (find-buffer-visiting buffile)
! 	(let* ((buffer (find-buffer-visiting file))
! 	       (coding-system (cond ((eq buffer (current-buffer))
! 	 
		     buffer-file-coding-system)
! 	 
		    (buffer (with-current-buffer buffer
! 	 
			      buffer-file-coding-system))
! 	 
		    (t (find-operation-coding-system
! 	 
			'insert-file-contents
! 	 
			file)))))
! 	  (when (consp coding-system)
! 	    (setq coding-system (car coding-system)))
! 	  (with-current-buffer (create-file-buffer buffile)
! 	    (message "Retrieving revision %s..." rev)
! 	    (let* ((coding-system-for-read coding-system) ; (or ... 'undecided)
! 		   (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)
! 	      (let ((buffer-file-name (expand-file-name file)))
! 		(after-find-file))
! 	      (toggle-read-only 1)
! 	      (message "Retrieving revision %s... Done" rev)
! 	      (current-buffer)))))))

   (eval-and-compile (autoload 'smerge-ediff "smerge-mode"))

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-09-10 22:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-10 22:27 cvs-retrieve-revision ignores the working file's coding system Kevin Rodgers

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.