Changeset 3655

Show
Ignore:
Timestamp:
2005年03月26日 02時15分33秒 (4 years ago)
Author:
miyoshi
Message:

(register-char-codings): Undo the last
change.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.1/lisp/ChangeLog.Meadow

    r3648 r3655  
     12005-03-26  MIYOSHI Masanori  <miyoshi@meadowy.org> 
     2 
     3        * international/mule.el (register-char-codings): Undo the last 
     4        change. 
     5 
    162005-03-22  KOSEKI Yoshinori  <kose@meadowy.org> 
    27 
  • branches/2.1/lisp/international/mule.el

    r3634 r3655  
    564564 
    565565(defun register-char-codings (coding-system safe-chars) 
    566   "Add entries for CODING-SYSTEM to `char-coding-system-table'. 
    567 If SAFE-CHARS is a char-table, its non-nil entries specify characters 
    568 which CODING-SYSTEM encodes safely.  If SAFE-CHARS is t, register 
    569 CODING-SYSTEM as a general one which can encode all characters." 
    570   (let ((general (char-table-extra-slot char-coding-system-table 0)) 
    571         ;; Charsets which have some members in the table, but not all 
    572         ;; of them (i.e. not just a generic character): 
    573         (partials (char-table-extra-slot char-coding-system-table 1))) 
     566  (let ((general (char-table-extra-slot char-coding-system-table 0))) 
    574567    (if (eq safe-chars t) 
    575568        (or (memq coding-system general) 
     
    577570                                       (cons coding-system general))) 
    578571      (map-char-table 
    579        (lambda (key val) 
    580          (if (and (>= key 128) val) 
    581              (let ((codings (aref char-coding-system-table key)) 
    582                    (charset (char-charset key))) 
    583                (unless (memq coding-system codings) 
    584                  (if (and (generic-char-p key) 
    585                           (memq charset partials)) 
    586                      ;; The generic char would clobber individual 
    587                      ;; entries already in the table.  First save the 
    588                      ;; separate existing entries for all chars of the 
    589                      ;; charset (with the generic entry added, if 
    590                      ;; necessary). 
    591                      (let (entry existing) 
    592                        (map-charset-chars 
    593                         (lambda (start end) 
    594                           (while (<= start end) 
    595                             (setq entry (aref char-coding-system-table start)) 
    596                             (when entry 
    597                               (push (cons 
    598                                      start 
    599                                      (if (memq coding-system entry) 
    600                                          entry 
    601                                        (cons coding-system entry))) 
    602                                     existing)) 
    603                             (setq start (1+ start)))) 
    604                         charset) 
    605                        ;; Update the generic entry. 
    606                        (aset char-coding-system-table key 
    607                              (cons coding-system codings)) 
    608                        ;; Override with the saved entries. 
    609                        (dolist (elt existing) 
    610                          (aset char-coding-system-table (car elt) (cdr elt)))) 
    611                    (aset char-coding-system-table key 
    612                          (cons coding-system codings)) 
    613                    (unless (or (memq charset partials) 
    614                                (generic-char-p key)) 
    615                      (push charset partials))))))) 
    616        safe-chars) 
    617       (set-char-table-extra-slot char-coding-system-table 1 partials)))) 
     572       (function 
     573        (lambda (key val) 
     574          (if (and (>= key 128) val) 
     575              (let ((codings (aref char-coding-system-table key))) 
     576                (or (memq coding-system codings) 
     577                    (aset char-coding-system-table key 
     578                          (cons coding-system codings))))))) 
     579       safe-chars)))) 
    618580 
    619581