;; Written by Valery Alexeev <valery@math.uga.edu>.
-(defun standard-display-cyrillic-translit (cyrillic-language)
+(defvar cyrillic-language-alist
+ (list '("Bulgarian") '("Macedonian") '("Serbocroatian")
+ '("Russian") '("Ukrainian"))
+ "*List of known cyrillic languages")
+
+(setq standard-display-table (make-display-table))
+
+;;;###autoload
+(defun standard-display-cyrillic-translit (&optional cyrillic-language)
"Display a cyrillic buffer using a transliteration.
For readability, the table is slightly
different from the one used for the input method `cyrillic-translit'.
-The argument specifies which language you are using;
+The argument is a string which specifies which language you are using;
that affects the choice of transliterations slightly.
-Possible values are `ukranian', `bulgarian' or t (any other language).
+Possible values are listed in 'cyrillic-language-alist'.
+If the argument is t, we use the default cyrillic transliteration.
If the argument is nil, we return the display table to its standard state."
+ (interactive)
+ (if (interactive-p)
+ (let* ((completion-ignore-case t))
+ (setq cyrillic-language
+ (completing-read
+ "Cyrillic language (default nil): "
+ cyrillic-language-alist nil t nil nil nil))))
+
+ (if (equal cyrillic-language "")
+ (setq cyrillic-language nil))
+
(if (null cyrillic-language)
(setq standard-display-table (make-display-table))
- (aset standard-display-table ?\81Ð [?a])
- (aset standard-display-table ?\81Ñ [?b])
- (aset standard-display-table ?\81Ò [?v])
- (aset standard-display-table ?\81Ó [?g])
- (aset standard-display-table ?\81Ô [?d])
- (aset standard-display-table ?\81Õ [?e])
- (aset standard-display-table ?\81ñ [?y?o])
- (aset standard-display-table ?\81Ö [?z?h])
- (aset standard-display-table ?\81× [?z])
- (aset standard-display-table ?\81Ø [?i])
- (aset standard-display-table ?\81Ù [?j])
- (aset standard-display-table ?\81Ú [?k])
- (aset standard-display-table ?\81Û [?l])
- (aset standard-display-table ?\81Ü [?m])
- (aset standard-display-table ?\81Ý [?n])
- (aset standard-display-table ?\81Þ [?o])
- (aset standard-display-table ?\81ß [?p])
- (aset standard-display-table ?\81à [?r])
- (aset standard-display-table ?\81á [?s])
- (aset standard-display-table ?\81â [?t])
- (aset standard-display-table ?\81ã [?u])
- (aset standard-display-table ?\81ä [?f])
- (aset standard-display-table ?\81å [?k?h])
- (aset standard-display-table ?\81æ [?t?s])
- (aset standard-display-table ?\81ç [?c?h])
- (aset standard-display-table ?\81è [?s?h])
- (aset standard-display-table ?\81é [?s?c?h])
- (aset standard-display-table ?\81ê [?~])
- (aset standard-display-table ?\81ë [?y])
- (aset standard-display-table ?\81ì [?'])
- (aset standard-display-table ?\81í [?e?'])
- (aset standard-display-table ?\81î [?y?u])
- (aset standard-display-table ?\81ï [?y?a])
-
- (aset standard-display-table ?\81° [?A])
- (aset standard-display-table ?\81± [?B])
- (aset standard-display-table ?\81² [?V])
- (aset standard-display-table ?\81³ [?G])
- (aset standard-display-table ?\81´ [?D])
- (aset standard-display-table ?\81µ [?E])
- (aset standard-display-table ?\81¡ [?Y?o])
- (aset standard-display-table ?\81¶ [?Z?h])
- (aset standard-display-table ?\81· [?Z])
- (aset standard-display-table ?\81¸ [?I])
- (aset standard-display-table ?\81¹ [?J])
- (aset standard-display-table ?\81º [?K])
- (aset standard-display-table ?\\81» [?L])
- (aset standard-display-table ?\81¼ [?M])
- (aset standard-display-table ?\81½ [?N])
- (aset standard-display-table ?\81¾ [?O])
- (aset standard-display-table ?\81¿ [?P])
- (aset standard-display-table ?\81À [?R])
- (aset standard-display-table ?\81Á [?S])
- (aset standard-display-table ?\81Â [?T])
- (aset standard-display-table ?\81Ã [?U])
- (aset standard-display-table ?\81Ä [?F])
- (aset standard-display-table ?\81Å [?K?h])
- (aset standard-display-table ?\81Æ [?T?s])
- (aset standard-display-table ?\81Ç [?C?h])
- (aset standard-display-table ?\81È [?S?h])
- (aset standard-display-table ?\81É [?S?c?h])
- (aset standard-display-table ?\81Ê [?~])
- (aset standard-display-table ?\81Ë [?Y])
- (aset standard-display-table ?\81Ì [?'])
- (aset standard-display-table ?\81Í [?E?'])
- (aset standard-display-table ?\81Î [?Y?u])
- (aset standard-display-table ?\81Ï [?Y?a])
-
- (aset standard-display-table ?\81ô [?i?e])
- (aset standard-display-table ?\81÷ [?i])
- (aset standard-display-table ?\81þ [?u])
- (aset standard-display-table ?\81ò [?d?j])
- (aset standard-display-table ?\81û [?c?h?j])
- (aset standard-display-table ?\81ó [?g?j])
- (aset standard-display-table ?\81õ [?s])
- (aset standard-display-table ?\81ü [?k])
- (aset standard-display-table ?\81ö [?i])
- (aset standard-display-table ?\81ø [?j])
- (aset standard-display-table ?\81ù [?l?j])
- (aset standard-display-table ?\81ú [?n?j])
- (aset standard-display-table ?\81ÿ [?d?z])
-
- (aset standard-display-table ?\81¤ [?Y?e])
- (aset standard-display-table ?\81§ [?Y?i])
- (aset standard-display-table ?\81® [?U])
- (aset standard-display-table ?\81¢ [?D?j])
- (aset standard-display-table ?\\81« [?C?h?j])
- (aset standard-display-table ?\81£ [?G?j])
- (aset standard-display-table ?\81¥ [?S])
- (aset standard-display-table ?\81¬ [?K])
- (aset standard-display-table ?\81¦ [?I])
- (aset standard-display-table ?\81¨ [?J])
- (aset standard-display-table ?\81© [?L?j])
- (aset standard-display-table ?\81ª [?N?j])
- (aset standard-display-table ?\81¯ [?D?j])
-
- (when (eq cyrillic-language 'bulgarian)
- (aset standard-display-table ?\81é [?s?h?t])
- (aset standard-display-table ?\81É [?S?h?t])
- (aset standard-display-table ?\81î [?i?u])
- (aset standard-display-table ?\81Î [?I?u])
- (aset standard-display-table ?\81ï [?i?a])
- (aset standard-display-table ?\81Ï [?I?a]))
-
- (when (eq cyrillic-language 'ukranian) ; based on the official
+ (aset standard-display-table ?\e,LP\e(B [?a])
+ (aset standard-display-table ?\e,LQ\e(B [?b])
+ (aset standard-display-table ?\e,LR\e(B [?v])
+ (aset standard-display-table ?\e,LS\e(B [?g])
+ (aset standard-display-table ?\e,LT\e(B [?d])
+ (aset standard-display-table ?\e,LU\e(B [?e])
+ (aset standard-display-table ?\e,Lq\e(B [?y?o])
+ (aset standard-display-table ?\e,LV\e(B [?z?h])
+ (aset standard-display-table ?\e,LW\e(B [?z])
+ (aset standard-display-table ?\e,LX\e(B [?i])
+ (aset standard-display-table ?\e,LY\e(B [?j])
+ (aset standard-display-table ?\e,LZ\e(B [?k])
+ (aset standard-display-table ?\e,L[\e(B [?l])
+ (aset standard-display-table ?\e,L\\e(B [?m])
+ (aset standard-display-table ?\e,L]\e(B [?n])
+ (aset standard-display-table ?\e,L^\e(B [?o])
+ (aset standard-display-table ?\e,L_\e(B [?p])
+ (aset standard-display-table ?\e,L`\e(B [?r])
+ (aset standard-display-table ?\e,La\e(B [?s])
+ (aset standard-display-table ?\e,Lb\e(B [?t])
+ (aset standard-display-table ?\e,Lc\e(B [?u])
+ (aset standard-display-table ?\e,Ld\e(B [?f])
+ (aset standard-display-table ?\e,Le\e(B [?k?h])
+ (aset standard-display-table ?\e,Lf\e(B [?t?s])
+ (aset standard-display-table ?\e,Lg\e(B [?c?h])
+ (aset standard-display-table ?\e,Lh\e(B [?s?h])
+ (aset standard-display-table ?\e,Li\e(B [?s?c?h])
+ (aset standard-display-table ?\e,Lj\e(B [?~])
+ (aset standard-display-table ?\e,Lk\e(B [?y])
+ (aset standard-display-table ?\e,Ll\e(B [?'])
+ (aset standard-display-table ?\e,Lm\e(B [?e?'])
+ (aset standard-display-table ?\e,Ln\e(B [?y?u])
+ (aset standard-display-table ?\e,Lo\e(B [?y?a])
+
+ (aset standard-display-table ?\e,L0\e(B [?A])
+ (aset standard-display-table ?\e,L1\e(B [?B])
+ (aset standard-display-table ?\e,L2\e(B [?V])
+ (aset standard-display-table ?\e,L3\e(B [?G])
+ (aset standard-display-table ?\e,L4\e(B [?D])
+ (aset standard-display-table ?\e,L5\e(B [?E])
+ (aset standard-display-table ?\e,L!\e(B [?Y?o])
+ (aset standard-display-table ?\e,L6\e(B [?Z?h])
+ (aset standard-display-table ?\e,L7\e(B [?Z])
+ (aset standard-display-table ?\e,L8\e(B [?I])
+ (aset standard-display-table ?\e,L9\e(B [?J])
+ (aset standard-display-table ?\e,L:\e(B [?K])
+ (aset standard-display-table ?\e,L;\e(B [?L])
+ (aset standard-display-table ?\e,L<\e(B [?M])
+ (aset standard-display-table ?\e,L=\e(B [?N])
+ (aset standard-display-table ?\e,L>\e(B [?O])
+ (aset standard-display-table ?\e,L?\e(B [?P])
+ (aset standard-display-table ?\e,L@\e(B [?R])
+ (aset standard-display-table ?\e,LA\e(B [?S])
+ (aset standard-display-table ?\e,LB\e(B [?T])
+ (aset standard-display-table ?\e,LC\e(B [?U])
+ (aset standard-display-table ?\e,LD\e(B [?F])
+ (aset standard-display-table ?\e,LE\e(B [?K?h])
+ (aset standard-display-table ?\e,LF\e(B [?T?s])
+ (aset standard-display-table ?\e,LG\e(B [?C?h])
+ (aset standard-display-table ?\e,LH\e(B [?S?h])
+ (aset standard-display-table ?\e,LI\e(B [?S?c?h])
+ (aset standard-display-table ?\e,LJ\e(B [?~])
+ (aset standard-display-table ?\e,LK\e(B [?Y])
+ (aset standard-display-table ?\e,LL\e(B [?'])
+ (aset standard-display-table ?\e,LM\e(B [?E?'])
+ (aset standard-display-table ?\e,LN\e(B [?Y?u])
+ (aset standard-display-table ?\e,LO\e(B [?Y?a])
+
+ (aset standard-display-table ?\e,Lt\e(B [?i?e])
+ (aset standard-display-table ?\e,Lw\e(B [?i])
+ (aset standard-display-table ?\e,L~\e(B [?u])
+ (aset standard-display-table ?\e,Lr\e(B [?d?j])
+ (aset standard-display-table ?\e,L{\e(B [?c?h?j])
+ (aset standard-display-table ?\e,Ls\e(B [?g?j])
+ (aset standard-display-table ?\e,Lu\e(B [?s])
+ (aset standard-display-table ?\e,L|\e(B [?k])
+ (aset standard-display-table ?\e,Lv\e(B [?i])
+ (aset standard-display-table ?\e,Lx\e(B [?j])
+ (aset standard-display-table ?\e,Ly\e(B [?l?j])
+ (aset standard-display-table ?\e,Lz\e(B [?n?j])
+ (aset standard-display-table ?\e,L\7f\e(B [?d?z])
+
+ (aset standard-display-table ?\e,L$\e(B [?Y?e])
+ (aset standard-display-table ?\e,L'\e(B [?Y?i])
+ (aset standard-display-table ?\e,L.\e(B [?U])
+ (aset standard-display-table ?\e,L"\e(B [?D?j])
+ (aset standard-display-table ?\e,L+\e(B [?C?h?j])
+ (aset standard-display-table ?\e,L#\e(B [?G?j])
+ (aset standard-display-table ?\e,L%\e(B [?S])
+ (aset standard-display-table ?\e,L,\e(B [?K])
+ (aset standard-display-table ?\e,L&\e(B [?I])
+ (aset standard-display-table ?\e,L(\e(B [?J])
+ (aset standard-display-table ?\e,L)\e(B [?L?j])
+ (aset standard-display-table ?\e,L*\e(B [?N?j])
+ (aset standard-display-table ?\e,L/\e(B [?D?j])
+
+ (when (equal cyrillic-language "Bulgarian")
+ (aset standard-display-table ?\e,Li\e(B [?s?h?t])
+ (aset standard-display-table ?\e,LI\e(B [?S?h?t])
+ (aset standard-display-table ?\e,Ln\e(B [?i?u])
+ (aset standard-display-table ?\e,LN\e(B [?I?u])
+ (aset standard-display-table ?\e,Lo\e(B [?i?a])
+ (aset standard-display-table ?\e,LO\e(B [?I?a]))
+
+ (when (equal cyrillic-language "Ukrainian") ; based on the official
; transliteration table
- (aset standard-display-table ?\81Ø [?y])
- (aset standard-display-table ?\81¸ [?Y])
- (aset standard-display-table ?\81Ù [?i])
- (aset standard-display-table ?\81¹ [?Y])
- (aset standard-display-table ?\81î [?i?u])
- (aset standard-display-table ?\81ï [?i?a]))))
+ (aset standard-display-table ?\e,LX\e(B [?y])
+ (aset standard-display-table ?\e,L8\e(B [?Y])
+ (aset standard-display-table ?\e,LY\e(B [?i])
+ (aset standard-display-table ?\e,L9\e(B [?Y])
+ (aset standard-display-table ?\e,Ln\e(B [?i?u])
+ (aset standard-display-table ?\e,Lo\e(B [?i?a]))))
+
;;
(provide 'cyril-util)
;;; cyril-util.el ends here
+
+;; Local Variables:
+;; buffer-file-coding-system: iso-2022-7bit
+;; End: