[Top][All Lists]

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

encoded-kb.el: ccl-based coding systems, UTF-8

From: Florian Weimer
Subject: encoded-kb.el: ccl-based coding systems, UTF-8
Date: 04 Mar 2001 23:17:08 +0100
User-agent: Gnus/5.090001 (Oort Gnus v0.01) Emacs/20.7

Emacs version: 20.7

encoded-kb.el does not handle ccl-based coding systems correctly if
they aren't treated specially.

>From 'encoded-kbd-setup-keymap':

   ((eq encoded-kbd-coding 'ccl)
    (let ((valid-codes (or (coding-system-get coding 'valid-codes)
                           '((128 255))))
          elt from to)
      (while valid-codes
        (setq elt (car valid-codes) valid-codes (cdr valid-codes))
        (if (consp elt)
            (setq from (car elt) to (cdr elt))
          (setq from (setq to elt)))
        (while (<= from to)
          (if (>= from 128)
              (define-key encoded-kbd-mode-map
                (vector from) 'encoded-kbd-self-insert-ccl))
          (setq from (1+ from))))))

The default value '((128 255))' for the 'valid-codes' property is
clearly wrong, as the following code cannot cope with it.  It should
probably be '((128 . 255))'.

The ccl fallback code cited above has the general problem that it uses
'encoded-kbd-self-insert-ccl', which cannot cope with multi-byte
characters.  I don't see a general way to solve this problem; however
the patch below fixes the problem mentioned above and implements UTF-8
support (for UCS-2 characters, at least).

Attachment: encoded-kb.el.diff
Description: Text Data

reply via email to

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