[COMMIT] Don't creat JIT mappings for U+0080-U+00FF at dump time

Aidan Kehoe kehoea at parhasard.net
Sat Jul 28 05:33:04 EDT 2007


APPROVE COMMIT

NOTE: This patch has been committed.

It turns out that a call to make-8-bit-coding-system at dump time (and not
at byte-compile time) like so: 

(make-8-bit-coding-system
 'windows-1252
 (list 
   (list #x80 (decode-char 'ucs #x20AC)) ;; EURO SIGN
   (list #x82 (decode-char 'ucs #x201A)) ;; SINGLE LOW-9 QUOTATION MARK
[...]
   (list #x9F (decode-char 'ucs #x0178)));; LATIN CAPITAL LETTER Y WITH DIAERESIS
 "Microsoft's Code Page 1252, for Western Europe and the Americas."
 '(mnemonic "cp1252"
   documentation
   "This is an extension of ISO 8859-1 that provides the Euro sign and
several punctuation marks not otherwise available in ISO 8859 1. It is
incompatible with ISO 2022, which is not a problem in the regions
where it is used.  "
   aliases (cp1252)))

created JIT mappings for U+00A0 to U+00FF at dump time. So files read in
using windows-1252 had Latin 1 characters distinct from the XEmacs Latin 1
characters. This patch changes that.

lisp/ChangeLog addition:

2007-07-28  Aidan Kehoe  <kehoea at parhasard.net>

	* mule/mule-coding.el (make-8-bit-create-decode-encode-tables):
	Don't creat JIT mappings for U+0080-U+00FF at dump time.


XEmacs Trunk source patch:
Diff command:   cvs -q diff -Nu
Files affected: lisp/mule/mule-coding.el
===================================================================
RCS

Index: lisp/mule/mule-coding.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mule/mule-coding.el,v
retrieving revision 1.21
diff -u -u -r1.21 mule-coding.el
--- lisp/mule/mule-coding.el	2007/07/27 18:56:53	1.21
+++ lisp/mule/mule-coding.el	2007/07/28 09:26:38
@@ -480,8 +480,13 @@
 	  ;; it'll be something else.
 	  (setq desired-ucs (+ private-use-start desired-ucs)
 		private-use-start (+ private-use-start 1)))
-	(aset decode-table i (decode-char 'ucs desired-ucs))
-	(puthash desired-ucs (int-to-char i) encode-table)))
+	(puthash desired-ucs (int-to-char i) encode-table)
+        (setq desired-ucs (if (> desired-ucs #xFF)
+                              (decode-char 'ucs desired-ucs)
+                            ;; So we get Latin-1 when run at dump time,
+                            ;; instead of JIT-allocated characters.
+                            (int-to-char desired-ucs)))
+        (aset decode-table i desired-ucs)))
     (values decode-table encode-table)))
 
 (defun make-8-bit-generate-decode-program (decode-table)

-- 
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)



More information about the XEmacs-Patches mailing list