������� | ������������ | ����� | ������ | ��������
���� | ��������� | ������ | �������� ����� | �����
������� << ������  << �����  << ���

������������ ��������� ���� � X/GNU Emacs'�

�������� ��������� ���� � emacs '� �������� � ��������� �� ������������ ������ ukrainian.el . ��� ������ �������� ��������� ������� ������ �������� ���������, �������������� ������ � ����� ������� ������� � ����, ��������������� ���� ��������� ���������, ����.

����� � emacs '�� ������� ����� ������������ ����������� �������� ��������� ��� ������. ���� ����� ����� ��������, ��������� ��� ����� ���������� �����. � ��������� �� ����������, � ����� �� ������� ��������������� emacs , �� ������ ������ ��� �� ����� �������. ��� X ������� ��� ��������, �� xrus �� kikbd. Xrus ���� ��������� � ������ ������������ �������, � ��� ��� �� kikbd � ����������� ��������� KDE � ���� ��������� �� ��� ������, �� ���� KDE ������.

����� ���������� ���������� �������� ����� ���� ������� ������ ��� ����� � emacs '��. �������� ����� ��� ��������� ����� ���������� �� ���������� ������. ��� ���� �� ������� ���������� (����� ����������� � ����������� �����), �� �� ������ �������� ����� ������� emacs '�. ����, ���� ��� �������� ����-��� �������, ������� ������������� � ���������� �����, �������� ������� �, ������������ � ���������� �����, ������������ ���������. ������� ����������� � ������ ������ � ����� ���� ��������. � ����, ��� � �������� ����� �� ������������ ������ ukrainian.el , � �� ���� ��������� ����� ������.

���� ����� � �������� ��������� �������� ��������� ���� � emacs '� �������� �������� ������� �� ���� �������. �� ��� ������� ������� ���� ��� ���� ���������� �� ����� ��������, � ���� ��� �����, �� ���� ���������� ������ � �������.

���� �� ������ ukrainian.el

����� ���� ��������� � ����� ����� � elisp'� GNU Emacs '� �� elisp'� X Emacs '� ������, ��������� ��� GNU Emacs '�, �� ������ � X Emacs '��.

��� �� ������ ������ ����� ���������� ����� ukrainian.el , ��� �������� ��������� � ����� ������� emacs '��.

����� emacs'�

��������� � ���� 20.x �� Emacs , ��� � X Emacs ����� �������� ��� �������� ���. �� �������� �'������� � ���� �������� ���� ������� ������� - emacs �� mule ( MU lti L anguage E macs).

� ����� ������ emacs '�� ������ ������ �������� ������� ������. � ���������� ������� ��������� ��������� ����� ���������� ��������� ������������ �����. � ���� ������� ����������� �� ���� ����, ���� ��� ������� ��� ������ "�����" �������� ������. �� ����� ������ ���������� ��������� �� ���� ������ � ������ ��� ����� �崳���� - ����� �� ���� � �������. ��� "�������" �������� ������ - ���������� ������� ��������� (���������, ��������), ��� ����, �� ��������, ���������, ���� - ������ ����� (������ 256 �������) �� �������. ��� mule (� ����� emacs ) ���������� ����'����� �� ������� ������ ������������ �����, ��� ������ ����� �� �����.

������� �����, emacs , � ����� �������� �������� �������������� ������� ������, ���� ����� ������ �� ��, �� ��� �� �������. � �����, ���� �� ������ ������ ��� ���, ��� �� �����, ������ ���� ���������, �� �� �� ������� � ����� ukrainian.el ��������.

���� ����� emacs ������� ������ ���, �� ����� � ��� �� ������������ �� ������� ������? ³������ ���� ������: ����� emacs �� ������� ��������� ����. � �� ����� ��� (������� 1999) �� �� ����� ���� ���� �����������. ϳ������� �������� ����, ��� ���� ����� � ���� emacs '�� ��� ��������� �� ��������, �, �� ���������, �� ��� ����� ������ � ����� ����, ���� �� �������.

���� �� ���� (x) emacs '� ����� ���� �����, 20 ��� ����� (��������� ����� ����� �� ��������� emacs -version ), �� ��� ������ ukrainian.el �������� ��� �� �����, ��� ������ �� ���� �������� ��� ����� emacs '�:

        emacs  --unibyte [��� � ���������, ����� �� �������������]

��� �������� ������� �������� ��� ���� ��� ���, �� ��������� � emacs . ��� � ���������, �� ������� ������������ ������������ ���� ����������� ������������� ���������, ����������, ����. ���� ���� ������ ������������ ���� ���, ���� ������� ��������� �� ���������. ϳ��� ������������ ������ russian.el, ������� ����� ������������ ���������. ��� ��� ��� ��, �� ������������� ������ ������ ���������.

��������� ���� �� .emacs

��� � ��������� �� ������� ������� ����� �����. ���� ���������� �� ���� ������, ���� ��������� ������ �� ����� . emacs , �� ��� ��������� �� ����� ������. �����, ���� �� �� ����쳺�� ��� �� ��� ����, ������ "cut-n-paste" �� �� ������ lisp ����, ������� ���� � . emacs � �� �����.

�� ������� emacs "�������" �������� �����

����� (����� ��?) �������� ����������� ������ ��� ������������ ukrainian.el � ��, �� emacs �� ����쳺 ��������� ������. �� �������� ����� � ����� ���������� ���������� �������. � ���� ����-��� ������� ���� ������ ����� ������/����� (M-x backward-kill-word, M-x forward-kill-word) ���� ���������� ������ - emacs ���� ���� ���������� ����� �� ������� �� ����� ��������� �����. ��� ���� ��������� ����������� �� ������: ������� M-x forward-word, M-x backward-word (������ - M-<������ ��������>, M-<������ ������>) ������������� �� ������ �� �������, � ����������� �������.

��������� ����� �������� ��������� �� �������. ����� cuc �� clc ���������� emacs �������� �� ������ ������� ��������� ����. ���, �� ����������� ������ ����� ��� ������ ������� koi8-u. ���� ����� � �� ������� �� ���������� � ����� ������ ukrainian.el , ��� ����� ������� ���� � ���� �������� - ���� � ��� ������ ������� �������.

        ;;;;;; Ukrainian/Russian viewing/input setting
        ;;;

        ;;
        ;; D.Kovalev (DK) [email protected] :- Some customizations around
        ;; ukrainian.el, russian.el and Cyrillic HOWTO from Linux HOWTO's
        ;; 
        ;; From Cyrillic HOWTO by Belikov :
        ;;
        ;; [...]  Emacs  doesn't know yet, that Cyrililic characters may
        ;; constitute a word, let alon the upper/lower case conversion
        ;; rules. In order to teach  Emacs  doing that, you have to modify the
        ;; syntax and case tables of  emacs :
        ;;
        (require 'case-table)
        ;; added 4 Ukrainian letters (DK)
        ;; � \246\266 
        ;; � \247\267
        ;; � \255\275
        ;; � \244\264
        ;;
        ;; Also changed r?c -> c?c from the source to be politically
        ;; correct. It's supposed to be 'Cyrillic Character', not 'Russian',
        ;; right? (DK) 
        ;;
                                                ; Attention !!! included here
                                                ; works only for KOI8-U, for
                                                ; other encodings 'cuc' and
                                                ; 'cul' entries must be
                                                ; redefined.
        (let* ((cuc "\266\267\275\264\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361")
               (clc "\246\247\255\244\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321")
               (i 0)
               (len (length cuc)))
          (while (< i len)
            (modify-syntax-entry (elt cuc i) "w  ")
            (modify-syntax-entry (elt clc i) "w  ")
            (set-case-syntax-pair (elt cuc i) (elt clc i) (standard-case-table))
            (setq i (+ i 1))))

������� ��� ������������ ����� ������� ������������� ��������� ����������� ��� �� �崳���� � �崳��� - ����� �� ����� ���������� ���� � �����, � �������.

�� ������� ���, ��� emacs ��������� �������� �����

� ����� ����� ������ ������ ����. ��� �������� ����� �� ��������� � �������� ������� � ���� ���� ��������� �� ���� ������� � ����������� emacs '�. ���� � ������� ��� �� ��� ������ ���������:

        ;; Ukrainian displaying mode -- file: ukrainian.el --------------
        ;; From Stephen Bobik
        
                                                ; Force the upper part of the
                                                ; ascii displayed as-it-is
        (standard-display-8bit 160 255)
                                                ; Load the  emacs  lisp code to
                                                ; perform koi8 text
                                                ; transformations.

�� ������� ���, ��� ����� ���� ������������� �� ����� ����������, � ����� � �������� ������

��� �������� �������� ���� � emacs '� ���� ����� ������ - russian.el (�� ����� �������� ukrainian.el ). emacs �������� ������������� ����� �������� ���������. ��� ����� ������� ����������� ������ ����� � emacs , �� �������� �� ��������� ���� ��������� ����� ������. �������� �����, �� � ��� ������ �� ����� � emacs Lisp'� ����������� � �������� ~/.lisp . ������ �� ����� �������� �� ���� �������.

        (load-file "~/.lisp/ukrainian.el")
        (load-file "~/.lisp/russian.el")

���, ���������� �� ����������� ������ � ��������� ������������� ���������. ���� ��, �����������, ���������, � ����������� ����� �������� �������� ������� M-x russian-insertion-mode , emacs ������� � ������ �������� ����� � ����� ��������� ����� ��. ��� ����, ��� �������� ������� � ������ � �����, ������� �������� ����� � ����������� ������ (�������� M-x ukrainian-insertion-mode , � ���� ��� ������� ��������� ����� �������� M-x russian-insertion-mode .

� ����������� ����� � ����� ����� ����� �������, �� ��� ����� ��� ���� � . emacs , � ������������ ��������� ����������������. ������� toggle-ukrainian , ���� �� ��� ������ ��������� ����� (�� ������� �� ���� ��� �� ���������, �� ��), � ���� ��� �������� ���������� ����� (����� ������������ � ����������� � ���������� � �������).

        ;; Because I have both Ukrainian and Russian in my  emacs  I need
        ;; following. If I, let's say, in Ukrainian insertion mode and want to
        ;; switch to Russian, I need to switch Ukrianian off first and *then*
        ;; turn Russian on. If I do 'M-x russian-insertion-mode', without
        ;; doing 'M-x ukrainian-insertion-mode' my keyboard ends up all
        ;; screwed. And vice-versa for switching from R -> U. So the
        ;; following 2 functions defined to provide easy "cross" switching
        ;; from one mode into another. (-DK)
        
        (defun toggle-ukrainian ()
          (interactive)
          "Make sure the Russian is off first and then toggle Ukrainian"
          (russian-insertion-mode -1)
          (ukrainian-insertion-mode)
          )

������� toggle-russian ������ ������� �� toggle-ukrainian .

        (defun toggle-russian ()
          (interactive)
          "Turn off Ukrainian mode before setting Russian mode"
          (ukrainian-insertion-mode -1)
          (russian-insertion-mode)
        )

����������� ��������

��� ����, ��� ���� ������ ���������� ��������� � ������ ������ � �����, � ���� . emacs ��������� ��� "���������� ������������":

        (global-set-key "\C-c\C-u" 'toggle-ukrainian)
        (local-set-key "\C-c\C-u" 'toggle-ukrainian)
        (global-set-key "\C-c\C-r" 'toggle-russian)
        (local-set-key "\C-c\C-r" 'toggle-russian)

CTRL-C, CTRL-U �����/������ ���������� �����, � CTRL-C, CTRL-R - ���������.

� - ������ �������������� ���. ������ ����'������, � ����� �'������� �������� �������� ������������ ���������, ��� (� ������ � ���� ���������� ������ �� �������������� ���) �������. � ���� ����� ������������ ��������� � ������ ��� � emacs '� ���� �� ��������� ��� �����, ����� � ����������� � ���� �� ���� � �������� - < CMD >-< SPACE >. � ����, ��������, � �� ��� ����� ��䳿 ������ �� ���� ������ (�� ����� ����������) �������� ������ < CMD >, ��� ���� �� �������� ��������� ������� �� �� < ALT >.

��������� ������ ���� �������� �������/�������� ���������� ����� �� ��������� < Alt >-< ������� >.

                                                ;Aug 11 1999
        ;; Two more bindings for Ukrainan - -
        (local-set-key  [?\M- ] 'toggle-ukrainian)
        (global-set-key [?\M- ] 'toggle-ukrainian)
        
        ;;
        ;; End of Ukrainian/Cyrillic settings
        ;;

ʳ���� ��� ��� ������������ ������� ukrainian.el

��� - � ������ ���� ��� ������������ ������� ukrainian.el , �������� ���, �� �� ��������� ����� �����������.

  • ��������/�������� ��������� ���������
    • M-x ukrainian-insertion-mode ���
    • Ctrl-c Ctrl-u ���
    • M-Space

�������� ������� � ������������ ��� emacs '�. � �� �������� ��� ����� ����, �� ��� ��� ���, �� ������� � ����� ��������, ���� �� �������� � ���������� �����.

  • ����� ������/ ����� �����
    • ������
      • M-x forward-word ���
      • M-f ���
      • M-<������ ��������>
    • �����
      • M-x backward-word ���
      • M-b ���
      • M-<������ ������>
  • ������ �����
    • �������� �� �������
      • M-d
    • ������ �� �������
      • M-Del ���
      • M-Backspace
  • ������ �崳��� �����
    • �������� �� �������
      • �� ��� �����
        • M-l
      • �� ����� �����
        • M-u
      • ������� ������� (����� ����� ������, �� ���� - ���)
        • M-c
    • ������ �� �������
      • �� ��� �����
        • M-"-" M-l
      • �� ����� �����
        • M-"-" M-u
      • ������� ������� (����� ����� ������, �� ���� - ���)
        • M-"-" M-c

ʳ���� �������� �����

������������� �� ������ ������ ������� � ���� (�������������) �� ��������� emacs'�.

������ ukrainian.el �������� �� ����� ������������� �� ���������� ������ ������ �������� ���������, ��� � �������������� ������ �� ������ ������ ������� � ����. ��� ����� �� �� �� ������� - ukrainian-translate-buffer �� ukrainian-translate-region.

����� ������� ���������� ���� ����� � ��������� �����, ����� - ����� �������� ���� ������.

���� ��, ���������, �������� �����, ���������� �� ³�����'� � ������ ������� windows-1251, � ���� ������ ����� ��� koi8-u, �������� ��������� ���� � emacs '�. � ��������� ��� �������:

  • M-x ukrainian-translate-buffer
  • emacs ������ ��� ������ �������, � ��� ����� �������������� �����. ������ � �������: cp1251
  • ��� emacs ������ ��� ������ �������, � ��� ����� �������������� �����. ������ � �������: 8koi.

������ ��� ������������� ������

���� ��� ���������� ������������ ������ ������ ����� (��� ������ ����� ������� ���� ��������� ����� � ��������� �� ����� ������), �� ������ �������� ���� ����������� ������ ��� ������������� ������.

³������� emacs � ���������� � ����� �� ����� �������� �����. ������� ���� �� �� ������� ��������, � ����, ��� ������ �� ����������, � ������ �� ����� ������ �� ��������:

            ����������������������������������������ե���������ƪ���̲���޿�

��� ������ ���� ������ ����� �����, � �� ��������� ������� ukrainian-translate-region ��������� ���� �� ����� � ������ ������� �� ��� (��� � ���) �� ��������� ����������� ������. ��� ������� ����� ������� ��� ��������� �����, ������� ����� ������� ��� ������������� tr � �� ���� ��������� ����� �� ������� ����� � ��� ��������� ������ �������.

��������� ������ ���������� ������ �� Windows-1251KOI8-U .

        #!/bin/sh
        tr \
        '����������Ӫ���������Ժ���˨������������������������������������' \
        '����������������������������������������ե���������ƪ���̲���޿�' 

����������� �� �����, ���� ��������� �� KOI8-UWindows-1251 � �����:

        #!/bin/sh
        tr \
        '����������������������������������������ե���������ƪ���̲���޿�' 
        '����������Ӫ���������Ժ���˨������������������������������������' \





������ ��������,
����, ������� 1999 �.
[email protected]


Natalya and Dmytro Kovalev
������ ��� �� �������: [email protected]
������� �������: http://www.asahi-net.or.jp/~as9d-kvlv
��� ��� 26 18:50:57 JST 1999
�����
 
[an error occurred while processing this directive] TopList
© 2000-2003, ���, ������� �������� -- ���� �� ����������, �������� ����������� -- ����� ������, ��i���� -- 08.06.2003 14:30:19