Mercurial > hg > xemacs-beta
comparison lisp/bytecomp.el @ 3948:adecfd791c9b
[xemacs-hg @ 2007-05-12 10:17:00 by aidan]
Non-Latin-1 escapes can lead to corrupted ELC code.
author | aidan |
---|---|
date | Sat, 12 May 2007 10:17:09 +0000 |
parents | 701dcae521bd |
children | 20accccbebd6 |
comparison
equal
deleted
inserted
replaced
3947:67e8a09db7ed | 3948:adecfd791c9b |
---|---|
1840 ;; Emacsen. | 1840 ;; Emacsen. |
1841 (if (or (featurep '(not mule)) ;; Don't scan buffer if we are not muleized | 1841 (if (or (featurep '(not mule)) ;; Don't scan buffer if we are not muleized |
1842 (save-excursion | 1842 (save-excursion |
1843 (set-buffer byte-compile-inbuffer) | 1843 (set-buffer byte-compile-inbuffer) |
1844 (goto-char (point-min)) | 1844 (goto-char (point-min)) |
1845 ;; mrb- There must be a better way than skip-chars-forward | 1845 ;; Look for any non-Latin-1 literals or Unicode character |
1846 (skip-chars-forward (concat (char-to-string 0) "-" | 1846 ;; escapes. Any such occurrences in a @#COUNT comment will lead |
1847 (char-to-string 255))) | 1847 ;; to an escape-quoted coding cookie being inserted, but this is |
1848 (eq (point) (point-max)))) | 1848 ;; not true of ordinary comments. |
1849 (let ((non-latin-1-re | |
1850 (concat "[^\000-\377]" | |
1851 #r"\|\\u[0-9a-fA-F]\{4,4\}\|\\U[0-9a-fA-F]\{8,8\}")) | |
1852 (case-fold-search nil)) | |
1853 (catch 'need-to-escape-quote | |
1854 (while (re-search-forward non-latin-1-re nil t) | |
1855 (skip-chars-backward "^;" (point-at-bol)) | |
1856 (if (bolp) (throw 'need-to-escape-quote nil)) | |
1857 (forward-line 1)) | |
1858 t)))) | |
1849 (setq buffer-file-coding-system 'raw-text-unix) | 1859 (setq buffer-file-coding-system 'raw-text-unix) |
1850 (insert "(or (featurep 'mule) (error \"Loading this file requires Mule support\")) | 1860 (insert "(or (featurep 'mule) (error \"Loading this file requires Mule support\")) |
1851 ;;;###coding system: escape-quoted\n") | 1861 ;;;###coding system: escape-quoted\n") |
1852 (setq buffer-file-coding-system 'escape-quoted) | 1862 (setq buffer-file-coding-system 'escape-quoted) |
1853 ;; #### Lazy loading not yet implemented for MULE files | 1863 ;; #### Lazy loading not yet implemented for MULE files |