changeset 4529:6f41fb7f3a65 bytecomp-coding-system-2008-10-29

Protect .elc encoding from latin-unity.
author Stephen J. Turnbull <stephen@xemacs.org>
date Wed, 29 Oct 2008 12:59:48 +0900
parents 726060ee587c
children 9b182263dbd7
files lisp/ChangeLog lisp/bytecomp.el
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Oct 29 04:06:33 2008 +0900
+++ b/lisp/ChangeLog	Wed Oct 29 12:59:48 2008 +0900
@@ -1,3 +1,7 @@
+2008-10-29  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* bytecomp.el (byte-compile-file): Protect encoding from latin-unity.
+
 2008-10-28  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* version.el (xemacs-betaname): Fix docstring typo.  (Thanks, Ville!)
--- a/lisp/bytecomp.el	Wed Oct 29 04:06:33 2008 +0900
+++ b/lisp/bytecomp.el	Wed Oct 29 12:59:48 2008 +0900
@@ -1618,7 +1618,10 @@
 	(unless byte-compile-overwrite-file
 	  (ignore-file-errors (delete-file target-file)))
 	(if (file-writable-p target-file)
-	    (write-region 1 (point-max) target-file)
+	    ;; prevent generic hooks from changing our format, eg,
+	    ;; latin-unity is known to change the coding system!
+	    (let ((write-region-pre-hook nil))
+	      (write-region 1 (point-max) target-file))
 	  ;; This is just to give a better error message than write-region
 	  (signal 'file-error
 		  (list "Opening output file"