comparison lisp/autoload.el @ 5101:65f5d45edc87

fix auto-autoloads when default coding system is utf-8 -------------------- ChangeLog entries follow: -------------------- lisp/ChangeLog addition: 2010-02-26 Ben Wing <ben@xemacs.org> * autoload.el (autoload-featurep-protect-autoloads): Always insert a coding-system cookie, either raw-text-unix or escape-quoted. As before, insert an error statement when an escape-quoted auto-autoload is loaded in a non-Mule XEmacs. This fixes problems when the default coding system is UTF-8, as in Cygwin. Under some circumstances, the file can get written out as raw text and read in as UTF-8, where invididual high-bytes are usually invalid UTF-8 sequences and lead to error octets in the buffer; when written out again, these force escape-quoted. Result: auto-autoloads.el for the source-tree lisp/ directory would end up as escape-quoted.
author Ben Wing <ben@xemacs.org>
date Fri, 26 Feb 2010 07:44:49 -0600
parents d555581e3cba
children 308d34e9f07d
comparison
equal deleted inserted replaced
5080:5502045ec510 5101:65f5d45edc87
1086 (insert ";;; DO NOT MODIFY THIS FILE") 1086 (insert ";;; DO NOT MODIFY THIS FILE")
1087 ;; NOTE: XEmacs prior to 21.5.12 or so had a bug in that it 1087 ;; NOTE: XEmacs prior to 21.5.12 or so had a bug in that it
1088 ;; recognized only one of the two magic-cookie styles (the -*- kind) 1088 ;; recognized only one of the two magic-cookie styles (the -*- kind)
1089 ;; in find-file, but both of them in load. We go ahead and put both 1089 ;; in find-file, but both of them in load. We go ahead and put both
1090 ;; in, just to be safe. 1090 ;; in, just to be safe.
1091 (insert (format " -*- coding: %s -*-\n" buffer-file-coding-system))
1091 (when (eq buffer-file-coding-system 'escape-quoted) 1092 (when (eq buffer-file-coding-system 'escape-quoted)
1092 (insert " -*- coding: escape-quoted; -*- 1093 (insert "(or (featurep 'mule) ")
1093 \(or (featurep 'mule) (error \"Loading this file requires Mule support\")) 1094 (insert "(error \"Loading this file requires Mule support\"))\n"))
1094 ;;;###coding system: escape-quoted")) 1095 (insert (format ";;;###coding system: %s\n"
1095 (insert "\n(if (featurep '" sym ")") 1096 buffer-file-coding-system))
1097 (insert "(if (featurep '" sym ")")
1096 (insert " (error \"Feature " sym " already loaded\"))\n") 1098 (insert " (error \"Feature " sym " already loaded\"))\n")
1097 (goto-char (point-max)) 1099 (goto-char (point-max))
1098 (save-excursion 1100 (save-excursion
1099 (forward-line -1) 1101 (forward-line -1)
1100 (when (looking-at "(provide") 1102 (when (looking-at "(provide")