Commits

Anonymous committed f7cf1a7

Non-MULE fixes <3ay8d1ur.fsf@mx.qsc.de>

Comments (0)

Files changed (6)

+2007-08-27  Ville Skyttä  <scop@xemacs.org>
+
+	* vc-xemacs.el (vc-xemacs-file-name-coding-system): New.
+	* vc-cvs.el (vc-cvs-repository-hostname): Use it.
+	* vc-cvs.el (vc-cvs-get-entries): Ditto.
+	* vc-svn.el (vc-svn-repository-hostname): Ditto.
+	* vc-xemacs.el (default-file-name-coding-system): Remove.
+
+	* vc.el (vc-coding-system-for-diff): Check that
+	`coding-system-for-read' and `buffer-file-coding-system' are
+	bound before using them.
+	* vc-cvs.el (vc-cvs-diff-tree): Ditto.
+	* vc-mcvs.el (vc-mcvs-diff-tree): Ditto.
+	
 2007-08-21  Ville Skyttä  <scop@xemacs.org>
 
 	* vc-rcs.el (vc-rcs-annotate-command): Use `substring' if
                  (vc-diff-internal ',f ',rev1 ',rev2))))))
       ;; cvs diff: use a single call for the entire tree
       (let ((coding-system-for-read
-             (or coding-system-for-read 'undecided)))
+             ;; XEmacs change: check if c-s-f-r is bound first
+             (or (and (boundp 'coding-system-for-read) coding-system-for-read)
+                 'undecided)))
         (apply 'vc-cvs-command "*vc-diff*" 1 nil "diff"
                (and rev1 (concat "-r" rev1))
                (and rev2 (concat "-r" rev2))
   (let ((rootname (expand-file-name "CVS/Root" dirname)))
     (when (file-readable-p rootname)
       (with-temp-buffer
-	(let ((coding-system-for-read
-	       (or file-name-coding-system
-		   default-file-name-coding-system)))
+	;; XEmacs change: use vc-xemacs-file-name-coding-system
+	(let ((coding-system-for-read (vc-xemacs-file-name-coding-system)))
 	  (vc-insert-file rootname))
 	(goto-char (point-min))
 	(nth 2 (vc-cvs-parse-root
 This function ensures that the correct coding system is used for that,
 which may not be the one that is used for the files' contents.
 CVS/Entries should only be accessed through this function."
-  (let ((coding-system-for-read (or file-name-coding-system
-                                    default-file-name-coding-system)))
+  ;; XEmacs change: use vc-xemacs-file-name-coding-system
+  (let ((coding-system-for-read (vc-xemacs-file-name-coding-system)))
     (vc-insert-file (expand-file-name "CVS/Entries" dir))))
 
 (defun vc-cvs-valid-symbolic-tag-name-p (tag)
     ;; valid relative names.
     (setq default-directory (vc-mcvs-root dir))
     ;; cvs diff: use a single call for the entire tree
-    (let ((coding-system-for-read (or coding-system-for-read 'undecided)))
+    (let ((coding-system-for-read
+	   ;; XEmacs change: check if c-s-f-r is bound first
+	   (or (and (boundp 'coding-system-for-read) coding-system-for-read)
+	       'undecided)))
       (apply 'vc-mcvs-command "*vc-diff*" 1 dir "diff"
 	     (and rev1 (concat "-r" rev1))
 	     (and rev2 (concat "-r" rev2))
 
 (defun vc-svn-repository-hostname (dirname)
   (with-temp-buffer
-    (let ((coding-system-for-read
-	   (or file-name-coding-system
-	       default-file-name-coding-system)))
+    ;; XEmacs change: use vc-xemacs-file-name-coding-system
+    (let ((coding-system-for-read (vc-xemacs-file-name-coding-system)))
       (vc-insert-file (expand-file-name (concat vc-svn-admin-directory
 						"/entries")
 					dirname)))
         (hg-find-file-hook))))
 (add-hook 'find-file-hooks 'vc-xemacs-hg-find-file-hook)
 
+;; Handle default-file-name-coding-system and non-MULE XEmacsen
+(defun vc-xemacs-file-name-coding-system ()
+  (or (when (boundp 'file-name-coding-system)
+        (or file-name-coding-system (default-value 'file-name-coding-system)))
+      'binary))
+
 ;; Compatibility
 
 (unless (boundp 'temporary-file-directory)
   (defvar temporary-file-directory (temp-directory)))
 
-(unless (boundp 'default-file-name-coding-system)
-  (defvar default-file-name-coding-system
-    (or (default-value 'file-name-coding-system) 'binary)))
-
 ;; Adapted from GNU Emacs' version in subr.el
 (unless (fboundp 'make-temp-file)
   (defun make-temp-file (prefix &optional dir-flag)
 
 (defun vc-coding-system-for-diff (file)
   "Return the coding system for reading diff output for FILE."
-  (or coding-system-for-read
+  ;; XEmacs change: check if c-s-f-r is bound first
+  (or (and (boundp 'coding-system-for-read) coding-system-for-read)
       ;; if we already have this file open,
       ;; use the buffer's coding system
       (let ((buf (find-buffer-visiting file)))
         (if buf (with-current-buffer buf
-                  buffer-file-coding-system)))
+                  ;; XEmacs change: check if b-f-c-s is bound first
+                  (and (boundp 'buffer-file-coding-system)
+                       buffer-file-coding-system))))
       ;; otherwise, try to find one based on the file name
       ;; XEmacs change: no find-operation-coding-system
       ;(car (find-operation-coding-system 'insert-file-contents file))