diff lisp/code-files.el @ 4271:fdf43260ae29

[xemacs-hg @ 2007-11-15 15:24:20 by aidan] Eliminate clean build build-failures on Mule
author aidan
date Thu, 15 Nov 2007 15:24:24 +0000
parents c5a2b80bc4fa
children 41e88d0c934e
line wrap: on
line diff
--- a/lisp/code-files.el	Thu Nov 15 10:05:16 2007 +0000
+++ b/lisp/code-files.el	Thu Nov 15 15:24:24 2007 +0000
@@ -559,14 +559,19 @@
                'write-region-pre-hook
                start end filename append visit lockname
                coding-system-or-mustbenew)
-              coding-system
+              (if (and coding-system-or-mustbenew
+		       (coding-system-p
+			(find-coding-system coding-system-or-mustbenew)))
+		  coding-system-or-mustbenew)
               buffer-file-coding-system
               (find-file-coding-system-for-write-from-filename filename)))
     (if (consp hook-result)
         ;; One of the `write-region-pre-hook' functions wrote the file. 
         hook-result
       ;; The hooks didn't do the work; do it ourselves.
-      (setq mustbenew (unless (coding-system-p coding-system-or-mustbenew)
+      (setq hook-result (find-coding-system hook-result)
+	    mustbenew (unless (coding-system-p
+			       (find-coding-system coding-system-or-mustbenew))
                         coding-system-or-mustbenew)
             coding-system (cond ((coding-system-p hook-result) hook-result)
                                 ((null mustbenew) coding-system-or-mustbenew))