gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch to mitigate slow Mule-UCS loading in Emacs 21.2


From: Dave Love
Subject: patch to mitigate slow Mule-UCS loading in Emacs 21.2
Date: 29 Mar 2002 00:06:56 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.95

A change in Emacs 21.2 causes furious consing when loading Mule-UCS's
un-define.  This change to un-define helps, getting the time to load
un-define down to 24s on my P133, but it's presumably not important on
much faster boxes.  Removing the definitions of encoding types you
don't need would obviously help too.  The patch applies to Mule-UCS
0.84 and probably earlier versions.

[The Emacs change was made to correct problems exposed by Mule-UCS:
the safe-chars entries for some CCL coding systems were clobbered.  I
don't know of anything other than Mule-UCS which is affected badly by
it.  Handa-san had a suggestion for an alternative technique which I
don't remember.]

Index: un-define.el
===================================================================
RCS file: /cvsroot/mule-ucs/lisp/un-define.el,v
retrieving revision 1.30
diff -u -p -r1.30 un-define.el
@@ -610,13 +624,21 @@ by calling post-read-conversion and pre-
 
  (mapcar
   (lambda (x)
-    (mapcar
-     (lambda (y)
-       (mucs-define-coding-system
-       (nth 0 y) (nth 1 y) (nth 2 y)
-       (nth 3 y) (nth 4 y) (nth 5 y) (nth 6 y))
-       (coding-system-put (car y) 'alias-coding-systems (list (car x))))
-     (cdr x)))
+    (if (fboundp 'register-char-codings)
+       ;; Mule 5, where we don't need the eol-type specified and
+       ;; register-char-codings may be very slow for these coding
+       ;; system definitions.
+       (let ((y (cadr x)))
+         (mucs-define-coding-system
+          (car x) (nth 1 y) (nth 2 y)
+          (nth 3 y) (nth 4 y) (nth 5 y)))
+      (mapcar
+       (lambda (y)
+        (mucs-define-coding-system
+         (nth 0 y) (nth 1 y) (nth 2 y)
+         (nth 3 y) (nth 4 y) (nth 5 y) (nth 6 y))
+        (coding-system-put (car y) 'alias-coding-systems (list (car x)))))
+      (cdr x)))
   `((utf-8
      (utf-8-unix
       ?u "UTF-8 coding system"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]