diff lisp/coding.el @ 5068:c673987f5f3d

dump make-coding-system -------------------- ChangeLog entries follow: -------------------- lisp/ChangeLog addition: 2010-02-22 Ben Wing <ben@xemacs.org> * mule/make-coding-system.el: * mule/make-coding-system.el (fixed-width-generate-helper): * mule/make-coding-system.el (fixed-width-private-use-start): Removed. * mule/make-coding-system.el (fixed-width-create-decode-encode-tables): * coding.el: * coding.el (decode-char): New. * coding.el (featurep): * coding.el (encode-char): New. * dumped-lisp.el (preloaded-file-list): Dump make-coding-system. Aidan's hack to avoid dumping this file never really worked right -- with some configurations (not clear exactly which ones) `make-coding-system.el' gets dumped anyway due to calls to `make-coding-system' in unicode.el, with the result that the documentation of functions in make-coding-system.el gets lost. Also needed to remove defvar fixed-width-private-use-start and incorporate it inline, due to bootstrapping issues -- the call to decode-char introduced a cross-dependency between unicode.el and make-coding-system.el.
author Ben Wing <ben@xemacs.org>
date Mon, 22 Feb 2010 21:26:18 -0600
parents 257b468bf2ca
children baffa6ca776a
line wrap: on
line diff
--- a/lisp/coding.el	Mon Feb 22 21:23:02 2010 -0600
+++ b/lisp/coding.el	Mon Feb 22 21:26:18 2010 -0600
@@ -5,7 +5,7 @@
 ;; Copyright (C) 1995 Amdahl Corporation.
 ;; Copyright (C) 1995 Sun Microsystems.
 ;; Copyright (C) 1997 MORIOKA Tomohiko
-;; Copyright (C) 2000, 2001, 2002 Ben Wing.
+;; Copyright (C) 2000, 2001, 2002, 2010 Ben Wing.
 
 ;; This file is part of XEmacs.
 
@@ -464,27 +464,25 @@
   (and (query-coding-string char coding-system)
        (encode-coding-string char coding-system)))
 
-(if (featurep 'mule)
-    (progn
-      ;; Under Mule, we do much of the complicated coding system creation in
-      ;; Lisp and especially at compile time. We need some function
-      ;; definition for this function to be created in this file, but we can
-      ;; leave assigning the docstring to the autoload cookie
-      ;; handling later. Thankfully; that docstring is big.
-      (autoload 'make-coding-system "mule/make-coding-system")
+(defun decode-char (quote-ucs code &optional restriction) 
+  "FSF compatibility--return Mule character with Unicode codepoint CODE.
+The second argument must be 'ucs, the third argument is ignored.  "
+  ;; We're prepared to accept invalid Unicode in unicode-to-char, but not in
+  ;; this function, which is the API that should actually be used, since
+  ;; it's available in GNU and in Mule-UCS.
+  (check-argument-range code #x0 #x10FFFF)
+  (assert (eq quote-ucs 'ucs) t
+	  "Sorry, decode-char doesn't yet support anything but the UCS.  ")
+  (unicode-to-char code))
 
-      ;; (During byte-compile before dumping, make-coding-system may already
-      ;; have been loaded, make sure not to overwrite the correct compiler
-      ;; macro:)
-      (when (eq 'autoload (car (symbol-function 'make-coding-system)))
-        ;; Make sure to pick up the correct compiler macro when compiling
-        ;; files:
-        (define-compiler-macro make-coding-system (&whole form name type
-                                                   &optional description props)
-          (load (second (symbol-function 'make-coding-system)))
-          (funcall (get 'make-coding-system 'cl-compiler-macro)
-                   form name type description props))))
+(defun encode-char (char quote-ucs &optional restriction)
+  "FSF compatibility--return the Unicode code point of CHAR.
+The second argument must be 'ucs, the third argument is ignored.  "
+  (assert (eq quote-ucs 'ucs) t
+	  "Sorry, encode-char doesn't yet support anything but the UCS.  ")
+  (char-to-unicode char))
 
+(unless (featurep 'mule)
   ;; Mule's not available; 
   (fset 'make-coding-system (symbol-function 'make-coding-system-internal))
   (define-coding-system-alias 'escape-quoted 'binary)