Subject: [patch] russian-typewriter input method does not follow actual layout

From: Vasily Korytov <[email-masked]>
Date: Sat, 06 Sep 2008 20:51:19 +0400

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

Russian `typewriter' keyboard layout actually has number keys in upper
case (i. e. punctuation is in lower) and Yo key in the bottom row.

E. g. the following article contains evidence (such as late 19 century
layouts, 20 century layouts, soviet computer layouts):
<http://www.artlebedev.com/mandership/105/>.

As well, the classic typewriter layout (with one minor change -- mapping
`|' instead of `§'` on the tilde key, `Russian Typewriter' computer
layout is implemented widely, e. g. in virtual keyboards:
<http://ourworld.compuserve.com/homepages/paulGor/screen_e.htm>.

But Emacs 22.2 has own standard for `russian-typewriter' input method.
Probably, borrowed from some other map. Indeed, there're a lot of
variations of `Russian Typewriter' implementation, a real mess.

In fact, I've already seen on the Net some Lisp files to implement a
correct typewriter layout (at least, in the number keys region) in
Emacs.

The patch, I'm proposing, makes `russian-typewriter' method behave like
a real Russian typewriter (except § key) or a Russian computer. I think,
it's better to fix the problem, that making users of
`russian-typewriter' implement a custom input method.

In GNU Emacs 22.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.12.9)
 of 2008-05-23 on xenbuilder2.fedora.redhat.com
Windowing system distributor `The X.Org Foundation', version 11.0.10499905
configured using `configure  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-x-toolkit=gtk' '--with-sound' '--with-toolkit-scroll-bars' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'target_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: en_US.UTF-8
  value of $LC_MONETARY: C
  value of $LC_NUMERIC: C
  value of $LC_TIME: C
  value of $LANG: ru_RU.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: LaTeX

Minor modes in effect:
  flyspell-mode: t
  show-paren-mode: t
  iswitchb-mode: t
  encoded-kbd-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<up> <down> <down> <up> <up> <left> <left> <right> 
<end> <home> <right> <right> <right> <down> <down> 
<right> <up> <up> C-x m q C-c C-g C-x b <return> C-c 
C-c <return> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <delete> <delete> SPC 
M-q C-x C-s <right> M-l M-q C-x C-s C-c C-c <return> 
<help-echo> <down-mouse-1> <mouse-movement> <mouse-movement> 
<drag-mouse-1> C-w <down-mouse-1> <mouse-1> Т а к , 
SPC <backspace> <backspace> ? SPC j l y j d h t v t 
y y j <delete> <delete> <delete> <delete> <delete> 
<delete> <delete> <delete> <delete> c <left> SPC M-й 
M-q <down> <down> <end> ? SPC в ы l t k f <backspace> 
z t n c z SPC t o ` SPC n h t n b q SPC r h b n t h 
b q SPC @ - - - SPC b n <backspace> SPC b v t y y j 
SPC j y SPC z d k z t n c z SPC j g h t l t k z . o 
b v / <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <backspace> ` <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<end> C-x C-s C-c C-c <return> <help-echo> <help-echo> 
<help-echo> M-x s e t - i n <tab> <return> r u s s 
<tab> t <tab> <return> \ | \ | = + 8 8 * * 7 & & & 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> M-x 
<up> <return> r u s s <tab> c o <tab> <return> C-x 
C-s M-x r e p o r t - e m <tab> <return>

Recent messages:
Wrote /home/deskpot/doc/postgrad/theory.tex
Type `C-c C-l' to display results of compilation.
LaTeX: successfully formatted {3} pages.
/home/deskpot/doc/postgrad/theory.tex clean.
Wrote /home/deskpot/doc/postgrad/theory.tex
Type `C-c C-l' to display results of compilation.
LaTeX: successfully formatted {3} pages.
/home/deskpot/doc/postgrad/theory.tex clean.
Wrote /home/deskpot/doc/postgrad/theory.tex
Loading emacsbug...done

--- leim/quail/cyrillic.el~	2008-01-10 15:15:30.000000000 +0300
+++ leim/quail/cyrillic.el	2008-09-06 20:34:04.000000000 +0400
@@ -54,25 +54,25 @@
  "ЙЦУКЕН Russian typewriter layout (ISO 8859-5 encoding)."
  nil t t t t nil nil nil nil nil t)
 
-;;  1! 2" 3' 4* 5: 6, 7. 8; 9( 0) -_ =+ Ё
-;;   Й  Ц  У  К  Е  Н  Г  Ш  Щ  З  Х  Ъ
+;;  №1 -2 /3 "4 :5 ,6 .7 _8 ?9 %0 != ;\ |+
+;;   Й  Ц  У  К  Е  Н  Г  Ш  Щ  З  Х  Ъ )(
 ;;    Ф  Ы  В  А  П  Р  О  Л  Д  Ж  Э
-;;     Я  Ч  С  М  И  Т  Ь  Б  Ю  /?
+;;     Я  Ч  С  М  И  Т  Ь  Б  Ю  Ё
 
 (quail-define-rules
- ("1" ?1)
- ("2" ?2)
- ("3" ?3)
- ("4" ?4)
- ("5" ?5)
- ("6" ?6)
- ("7" ?7)
- ("8" ?8)
- ("9" ?9)
- ("0" ?0)
- ("-" ?-)
- ("=" ?=)
- ("`" ?ё)
+ ("1" ?№)
+ ("2" ?-)
+ ("3" ?/)
+ ("4" ?\")
+ ("5" ?:)
+ ("6" ?,)
+ ("7" ?.)
+ ("8" ?_)
+ ("9" ??)
+ ("0" ?%)
+ ("-" ?!)
+ ("=" ?\;)
+ ("`" ?|)
  ("q" ?й)
  ("w" ?ц)
  ("e" ?у)
@@ -96,7 +96,7 @@
  ("l" ?д)
  (";" ?ж)
  ("'" ?э)
- ("\\" ?\\)
+ ("\\" ?\))
  ("z" ?я)
  ("x" ?ч)
  ("c" ?с)
@@ -106,21 +106,21 @@
  ("m" ?ь)
  ("," ?б)
  ("." ?ю)
- ("/" ?/)
+ ("/" ?ё)
 
- ("!" ?!)
- ("@" ?\")
- ("#" ?')
- ("$" ?*)
- ("%" ?:)
- ("^" ?,)
- ("&" ?.)
- ("*" ?\;)
- ("(" ?\()
- (")" ?\))
- ("_" ?_)
- ("+" ?+)
- ("~" ?Ё)
+ ("!" ?1)
+ ("@" ?2)
+ ("#" ?3)
+ ("$" ?4)
+ ("%" ?5)
+ ("^" ?6)
+ ("&" ?7)
+ ("*" ?8)
+ ("(" ?9)
+ (")" ?0)
+ ("_" ?=)
+ ("+" ?\\)
+ ("~" ?+)
  ("Q" ?Й)
  ("W" ?Ц)
  ("E" ?У)
@@ -144,7 +144,7 @@
  ("L" ?Д)
  (":" ?Ж)
  ("\"" ?Э)
- ("|" ?|)
+ ("|" ?\()
  ("Z" ?Я)
  ("X" ?Ч)
  ("C" ?С)
@@ -154,7 +154,7 @@
  ("M" ?Ь)
  ("<" ?Б)
  (">" ?Ю)
- ("?" ??)
+ ("?" ?Ё)
  )
 
 ;; Maintain the obsolete name for now.