Re: Question about Polish input method

"Stephen J. Turnbull" <[email protected]> Thu, 15 May 2003 22:32:11 +0900
Newsgroups gmane.emacs.xemacs.mule
Organization The XEmacs Project
Message-ID <[email protected]>
>>>>> "Jakub" == Jakub Nadolny <[email protected]> writes:

    Jakub> when I try to have some Polish diactrical characters, such
    Jakub> as ą, ę, ć etc. I press right alt + letter (e.g. alt + a to
    Jakub> have ą) and there is a message "aogonek not
    Jakub> defined". Similar message for other letters:

I don't really understand the low-level keyboard code; there is
support for recognizing these keysyms, but they're not used for input
by default.  Seems crazy.  If you execute the expression below, you
should be able to use Alt + letter to enter Polish characters.  This
assumes that you are using a Mule build; if not, you'll get a bunch of
errors for `make-char'.  In the no-Mule case, probably (1) using
iso8859-2 fonts and (2) executing

(defun make-char (charset o1 o2)
  (when o2
    (error 'invalid-argument "No multibyte characters in 8-bit Emacs!" o2))
  (if (not o1)
      (error 'invalid-argument "Must specify a code point!")
    (int-to-char o1)))

before reexecuting the expression.

If it works, please let us know.  If you get any warnings about
redefinitions, I'd also like to know.  Thanks!

If you get Polish characters, but the correspondence to keystrokes
doesn't make sense, don't hesitate to let us know.

    Jakub> So it looks like there is no input method for Polish
    Jakub> language?  Can you help me?

Besides the direct input method above, you could use the leim package
(M-x list-packages, update the index, get and install leim), which
provides a number of input methods including latin-2-prefix and
latin-2-postfix.

(mapcar
  (lambda (pair)
    (let ((keysym (car pair)) (code (cdr pair)))
      (when (lookup-key global-map (vector keysym))
        (warn (format
               "Overriding existing keymapping for %s to self-insert-command"
               keysym)))
      (define-key global-map (vector keysym) #'self-insert-command)
      (when (get 'EuroSign 'ascii-character)
        (warn (format
               "Overriding existing definition of %s to #x%02x"
               keysym code)))
      (put keysym 'ascii-character (make-char 'latin-iso8859-2 code))))
  '((Aogonek             . #xa1)
    (breve               . #xa2)
    (Lstroke             . #xa3)
    (Lcaron              . #xa5)
    (Sacute              . #xa6)
    (Scaron              . #xa9)
    (Scedilla            . #xaa)
    (Tcaron              . #xab)
    (Zacute              . #xac)
    (Zcaron              . #xae)
    (Zabovedot           . #xaf)
    (aogonek             . #xb1)
    (ogonek              . #xb2)
    (lstroke             . #xb3)
    (lcaron              . #xb5)
    (sacute              . #xb6)
    (caron               . #xb7)
    (scaron              . #xb9)
    (scedilla            . #xba)
    (tcaron              . #xbb)
    (zacute              . #xbc)
    (doubleacute         . #xbd)
    (zcaron              . #xbe)
    (zabovedot           . #xbf)
    (Racute              . #xc0)
    (Abreve              . #xc3)
    (Lacute              . #xc5)
    (Cacute              . #xc6)
    (Ccaron              . #xc8)
    (Eogonek             . #xca)
    (Ecaron              . #xcc)
    (Dcaron              . #xcf)
    (Dstroke             . #xd0)
    (Nacute              . #xd1)
    (Ncaron              . #xd2)
    (Odoubleacute        . #xd5)
    (Rcaron              . #xd8)
    (Uring               . #xd9)
    (Udoubleacute        . #xdb)
    (Tcedilla            . #xde)
    (racute              . #xe0)
    (abreve              . #xe3)
    (lacute              . #xe5)
    (cacute              . #xe6)
    (ccaron              . #xe8)
    (eogonek             . #xea)
    (ecaron              . #xec)
    (dcaron              . #xef)
    (dstroke             . #xf0)
    (nacute              . #xf1)
    (ncaron              . #xf2)
    (odoubleacute        . #xf5)
    (udoubleacute        . #xfb)
    (rcaron              . #xf8)
    (uring               . #xf9)
    (tcedilla            . #xfe)
    (abovedot            . #xff)))


-- 
Institute of Policy and Planning Sciences     http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.