emacs-devel
[Top][All Lists]
Advanced

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

Re: Q: something like autoload for coding-systems?


From: Stefan Monnier
Subject: Re: Q: something like autoload for coding-systems?
Date: Sun, 04 Nov 2001 16:42:54 -0500

> I implemented that some time ago (and advertised so somewhere).  What
> I did may not be the best way, but works.  I don't know whether or not
> it's on my CVS branch.
> 
> I'm not sure it's actually worth autoloading a few tens of 8-bit
> coding systems -- I haven't measured how much space they use.

But if we want to be able to encode/decode things like big chinese
charsets into Unicode, it might being to make sense to autoload those
big tables (assuming the mapping between the two is such a big table
and can't be easily compressed).
Also we could even make *all* coding systems autoloaded, at which point
all those 8bit tables can start to accumulate into something more
measurable.  But I agree that it's not of extreme importance.


        Stefan

PS: It does seem to be on your branch.  See the (reversed) hunk below.
PPS: By the way, for people who want to take a look at your branch,
     I have made a patch out of it (it required a bit of work because
     the base of the branch wasn't easily available).


***************
*** 3402,3432 ****
    if (NILP (coding_system))
      goto label_invalid_coding_system;
  
-  label_retry:
    coding_spec = Fget (coding_system, Qcoding_system);
  
    if (!VECTORP (coding_spec)
        || XVECTOR (coding_spec)->size != 5
        || !CONSP (XVECTOR (coding_spec)->contents[3]))
!     {
!       /* Should we do an autoload?  Autoload function forms for coding
!        systems have Qcoding_system as their fifth element.  */
!       coding_spec = XSYMBOL (coding_spec)->function;
!       if (CONSP (coding_spec)
!         && EQ (XCAR (coding_spec), Qautoload)
!         && EQ (Fnth (make_number (4), coding_spec), Qcoding_system))
!       {
!         struct gcpro gcpro1, gcpro2;
! 
!         GCPRO2 (coding_spec, coding_system);
!         do_autoload (coding_spec, coding_system);
!         UNGCPRO;
! 
!         goto label_retry;
!       }
!       else
!       goto label_invalid_coding_system;
!     }
  
    eol_type = inhibit_eol_conversion ? Qnil : Fget (coding_system, Qeol_type);
    if (VECTORP (eol_type))
--- 3401,3412 ----
    if (NILP (coding_system))
      goto label_invalid_coding_system;
  
    coding_spec = Fget (coding_system, Qcoding_system);
  
    if (!VECTORP (coding_spec)
        || XVECTOR (coding_spec)->size != 5
        || !CONSP (XVECTOR (coding_spec)->contents[3]))
!     goto label_invalid_coding_system;
  
    eol_type = inhibit_eol_conversion ? Qnil : Fget (coding_system, Qeol_type);
    if (VECTORP (eol_type))




reply via email to

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