🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.editor.emacs
Article #380

Anthy Kana with US Keyboard / Backslash problem

#380
From: Yasushi Shinjo
Date: Tue, 02 Sep 2008 08:21
166 lines
9243 bytes
$B?7>k!wC^GHBg3X>pJs$G$9!#$3$s$K$A$O!#(B

Anthy $B$r$+$JBG$A$G;H$*$&$H$7$F$$$^$9!#IUB0$N$b$N$G$O!"%-!<%\!<(B
$B%I$H$7$F(B JIS $BG[Ns$r2>Dj$7$F$$$?$N$G!"(BUS $BG[Ns$G;H$($k$h$&$K!"(B
$B=$@5$7$F$_$^$7$?!#$3$l$O!"$@$$$?$$$&$^$/$$$C$?$N$G$9$,!"0lIt!"(B
$B$&$^$/9T$+$J$$=j$,$"$j$^$9!#$=$l$O!"%P%C%/%9%i%C%7%e$,Mm$s$@(B
$B$"$?$j$G$9!#(B

(defvar anthy-kana-mode-hiragana-map-us
  '(
     ... ("\\" . "$B$X(B") ("\\[" . "$B$Y(B") ("\\=" . "$B$Z(B") ...
   ))

$B!V$X!W$K!"!V(B\$B!W$r3d$jEv$F$^$7$?!#$3$l$O$&$^$/$$$-$^$9!#(B
$B!V$Y!W$K!V(B\[$B!W$r3d$jEv$F$h$&$H$7$F$b!"$&$^$/$$$-$^$;$s!#(B
$B!V$Z!W$K!V(B\=$B!W$r3d$jEv$F$h$&$H$7$F$b!"$&$^$/$$$-$^$;$s!#(B

$B$3$l$r2r7h$9$k$?$a$N2?$+%R%s%H$O$J$$$G$7$g$&$+!#(B

$B$H$j$"$($:$O!"<!$N$h$&$JDj5A$rF~$l$F$7$N$$$G$O$$$^$9!#(B
    ("|" . "$B$X(B")    ("|[" . "$B$Y(B")    ("|=" . "$B$Z(B")
$B!V$X!W$K!V(B|$B!W$r3d$jEv$F$^$7$?!#(B

$B;H$C$F$$$k(B Anthy $B$O!"(Banthy-9100e $B$G$9!#(BEmacs $B$O!"(B22.0.91.1 
$B$G$9!#$h$m$7$/$*4j$$$7$^$9!#(B

$B!@!@!!?7>k!!Lw!!!J$7$s$8$g$&!!$d$9$7!K!!!@!@(B
$B!@!@!!C^GHBg3X!!EE;R!&>pJs!!!!!!!!!!!!!!!@!@(B

$B0J2<$O!"(Banthy-conf.el $B$r>/$7=$@5$7$F:n$C$?(B anthy-conf-us.el 
$B$H$$$&$b$N$G$9!#(B-map $B$H$$$&$N$K(B -map-us $B$HJQ99$7$F:n$j$^$7$?!#(B
$B0lIt$b$I$7$?$b$N$b$"$j$^$9!#;H$o$l$F$$$J$$JQ?t$b$"$k$+$H;W$$(B
$B$^$9!#(B

----------------------------------------------------------------------
;; anthy-conf-us.el -- Anthy Kana for US layout keyboard


;; Copyright (C) 2002
;; Author: Yusuke Tabata<yusuke@kmc.gr.jp>

;; Modified by Yasushi Shinjo <yas@is.tsukuba.ac.jp>
;; 2008/09/02 17:14:20


;;; Commentary:
;;

(defvar anthy-alt-char-map-us
  '(("," "$B!$(B")
    ("." "$B!%(B")))

(defvar anthy-kana-mode-hiragana-map-us
  '(
    ("3" . "$B$"(B")    ("e" . "$B$$(B")    ("4" . "$B$&(B")    ("5" . "$B$((B")    ("6" . "$B$*(B")
    ("#" . "$B$!(B")    ("E" . "$B$#(B")    ("$" . "$B$%(B")    ("%" . "$B$'(B")    ("^" . "$B$)(B")
    ("t" . "$B$+(B")    ("g" . "$B$-(B")    ("h" . "$B$/(B")    ("'" . "$B$1(B")    ("b" . "$B$3(B")
    ("t[" . "$B$,(B")   ("g[" . "$B$.(B")    ("h[" . "$B$0(B")    ("'[" . "$B$2(B")    ("b[" . "$B$4(B")
    ("x" . "$B$5(B")    ("d" . "$B$7(B")    ("r" . "$B$9(B")    ("p" . "$B$;(B")    ("c" . "$B$=(B")
    ("x[" . "$B$6(B")   ("d[" . "$B$8(B")    ("r[" . "$B$:(B")    ("p[" . "$B$<(B")    ("c[" . "$B$>(B")
    ("q" . "$B$?(B")    ("a" . "$B$A(B")    ("z" . "$B$D(B")    ("w" . "$B$F(B")    ("s" . "$B$H(B")
    ("q[" . "$B$@(B")   ("a[" . "$B$B(B")    ("z[" . "$B$E(B")    ("w[" . "$B$G(B")    ("s[" . "$B$I(B")
    ("u" . "$B$J(B")    ("i" . "$B$K(B")    ("1" . "$B$L(B")    ("," . "$B$M(B")    ("k" . "$B$N(B")
    ("f" . "$B$O(B")    ("v" . "$B$R(B")    ("2" . "$B$U(B")    ("\\" . "$B$X(B")    ("-" . "$B$[(B")
    ("f[" . "$B$P(B")   ("v[" . "$B$S(B")    ("2[" . "$B$V(B")    ("\\[" . "$B$Y(B")    ("f[" . "$B$\(B")
    ("f=" . "$B$Q(B")   ("v=" . "$B$T(B")    ("2=" . "$B$W(B")    ("\\=" . "$B$Z(B")    ("-=" . "$B$](B")
    ("j" . "$B$^(B")    ("n" . "$B$_(B")    ("]" . "$B$`(B")    ("/" . "$B$a(B")    ("m" . "$B$b(B")
    ("7" . "$B$d(B")    ("8" . "$B$f(B")    ("9" . "$B$h(B")
    ("&" . "$B$c(B")    ("*" . "$B$e(B")    ("(" . "$B$g(B")
    ("o" . "$B$i(B")    ("l" . "$B$j(B")    ("." . "$B$k(B")    (";" . "$B$l(B")    ("\"" . "$B$m(B")
    ("0" . "$B$o(B")    (")" . "$B$r(B")

    ;; $B:$$C$?$3$H$K(B $B%P%C%/%9%i%C%7%e$H1_$r6hJL$9$kJ}K!$,$o$+$i$J$$(B
    ("}" . "$B!<(B")    ("_" . "$B$m(B")    ("<" . "$B!"(B")    (">" . "$B!#(B")    ("?" . "$B!&(B")
    ("Z" . "$B$C(B")    ("y" . "$B$s(B")

    ("!" . "$B!*(B")    ("@" . "$B!w(B")    ("+" . "$B!V(B")    ("{" . "$B!W(B")    ("`" . "$B!.(B")
    ("~" . "$B!A(B")    ("[" . "$B!+(B")    ("=" . "$B!,(B")
    ("|" . "$B$X(B")    ("|[" . "$B$Y(B")    ("|=" . "$B$Z(B")    (":" . "$B$l(B")
    ))

(defvar anthy-kana-mode-katakana-map-us
  '(
    ("3" . "$B%"(B")    ("e" . "$B%$(B")    ("4" . "$B%&(B")    ("5" . "$B%((B")    ("6" . "$B%*(B")
    ("#" . "$B%!(B")    ("E" . "$B%#(B")    ("$" . "$B%%(B")    ("%" . "$B%'(B")    ("^" . "$B%)(B")
    ("t" . "$B%+(B")    ("g" . "$B%-(B")    ("h" . "$B%/(B")    ("'" . "$B%1(B")    ("b" . "$B%3(B")
    ("t[" . "$B%,(B")    ("g[" . "$B%.(B")    ("h[" . "$B%0(B")    ("'[" . "$B%2(B")    ("b[" . "$B%4(B")
    ("x" . "$B%5(B")    ("d" . "$B%7(B")    ("r" . "$B%9(B")    ("p" . "$B%;(B")    ("c" . "$B%=(B")
    ("x[" . "$B%6(B")    ("d[" . "$B%8(B")    ("r[" . "$B%:(B")    ("p[" . "$B%<(B")    ("c[" . "$B%>(B")
    ("q" . "$B%?(B")    ("a" . "$B%A(B")    ("z" . "$B%D(B")    ("w" . "$B%F(B")    ("s" . "$B%H(B")
    ("q[" . "$B%@(B")    ("a[" . "$B%B(B")    ("z[" . "$B%E(B")    ("w[" . "$B%G(B")    ("s[" . "$B%I(B")
    ("u" . "$B%J(B")    ("i" . "$B%K(B")    ("1" . "$B%L(B")    ("," . "$B%M(B")    ("k" . "$B%N(B")
    ("f" . "$B%O(B")    ("v" . "$B%R(B")    ("2" . "$B%U(B")    ("\\" . "$B%X(B")    ("-" . "$B%[(B")
    ("f[" . "$B%P(B")    ("v[" . "$B%S(B")    ("2[" . "$B%V(B")    ("\\[" . "$B%Y(B")    ("-[" . "$B%\(B")
    ("f=" . "$B%Q(B")    ("v=" . "$B%T(B")    ("2=" . "$B%W(B")    ("\\=" . "$B%Z(B")    ("-=" . "$B%](B")
    ("j" . "$B%^(B")    ("n" . "$B%_(B")    ("]" . "$B%`(B")    ("/" . "$B%a(B")    ("m" . "$B%b(B")
    ("7" . "$B%d(B")    ("8" . "$B%f(B")    ("9" . "$B%h(B")
    ("&" . "$B%c(B")    ("(" . "$B%e(B")    (")" . "$B%g(B")
    ("o" . "$B%i(B")    ("l" . "$B%j(B")    ("." . "$B%k(B")    (";" . "$B%l(B")    ("\"" . "$B%m(B")
    ("0" . "$B%o(B")    (")" . "$B%r(B")

    ;; $B:$$C$?$3$H$K(B $B%P%C%/%9%i%C%7%e$H1_$r6hJL$9$kJ}K!$,$o$+$i$J$$(B
    ("}" . "$B!<(B")    ("_" . "$B%m(B")    ("<" . "$B!"(B")    (">" . "$B!#(B")    ("?" . "$B!&(B")
    ("Z" . "$B%C(B")    ("y" . "$B%s(B")

    ("!" . "$B!*(B")    ("@" . "$B!w(B")    ("+" . "$B!V(B")    ("{" . "$B!W(B")    ("`" . "$B!.(B")
    ("~" . "$B!A(B")    ("[" . "$B!+(B")    ("=" . "$B!,(B")
    ("|" . "$B%X(B")    ("|[" . "$B%Y(B")   ("|=" . "$B%Z(B")   (":" . "$B%l(B")
    ))
;;
;; map$B$NJQ99(B
;;
(defun anthy-send-map-us-edit-command (mapno key str)
  (if (not (stringp key))
      (setq key (char-to-string key)))
  (if (not (stringp str))
      (setq str (char-to-string str)))
  (anthy-send-recv-command
   (concat " MAP_EDIT " (int-to-string mapno)
	   " " key " " str "\n")))
(defun anthy-change-hiragana-map-us (key str)
  (anthy-send-map-us-edit-command 2 key str))
(defun anthy-change-katakana-map-us (key str)
  (anthy-send-map-us-edit-command 3 key str))
(defun anthy-load-hiragana-map-us (map)
  (mapcar (lambda (x)
	    (let ((key (car x))
		  (str (cadr x)))
	      (anthy-change-hiragana-map-us key str))) map))
(defun anthy-clear-map-us ()
  (anthy-send-recv-command
   " MAP_CLEAR 0\n"))
;;
;; toggle$B$NJQ99(B
;;
(defun anthy-send-change-toggle-command (str)
  (anthy-send-recv-command
   (concat " CHANGE_TOGGLE " str "\n")))

;; should disable toggle
;; ($B%m!<%^;z$G$O$J$/$F(B)$B$+$J%b!<%I$K$9$k(B
(defun anthy-kana-map-us-mode ()
  (setq anthy-rkmap-keybind
	'(
	  ;; \C-p
	  (("hiragana" . 16) . "katakana")
	  (("katakana" . 16) . "hiragana")))
  (define-key anthy-mode-map (char-to-string 16) 'anthy-insert)
  (anthy-send-recv-command " SET_PREEDIT_MODE 1\n")
  (anthy-send-change-toggle-command "!")
  (anthy-clear-map-us)
  (mapcar (lambda (x)
	    (anthy-change-hiragana-map-us (car x) (cdr x)))
	  anthy-kana-mode-hiragana-map-us)
  (mapcar (lambda (x)
	    (anthy-change-katakana-map-us (car x) (cdr x)))
	  anthy-kana-mode-katakana-map-us))
;;
(defun anthy-set-break-into-roman (flag)
  "$BFI$_$rF~NOCf$K%P%C%/%9%Z!<%9$rBG$D$H%m!<%^;z$^$G%P%i%P%i$K$9$k(B"
  (anthy-send-recv-command
   (if flag
       " BREAK_INTO_ROMAN 1\n"
     " BREAK_INTO_ROMAN 0\n")))

(provide 'anthy-conf-us)
Technical Details
Message-ID: <YAS.08Sep2172120@kirk.is.tsukuba.ac.jp>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed2.kddnet.ad.jp!newsfeed2.kddnet.ad.jp!jpix!mmcatv.co.jp!CALA-MUZIK!ie.u-ryukyu.ac.jp!gama.is.tsukuba.ac.jp!yas

Show Full Headers
Complete Article Headers
X-Google-Thread: ff358,114a671fac31ad2b,start
X-Google-Thread: 100ca4,114a671fac31ad2b,start
X-Google-Attributes: gidff358,gid100ca4,domainid0,public,usenet
X-Google-Language: Japanese,JIS
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed2.kddnet.ad.jp!newsfeed2.kddnet.ad.jp!jpix!mmcatv.co.jp!CALA-MUZIK!ie.u-ryukyu.ac.jp!gama.is.tsukuba.ac.jp!yas
From: yas@is.tsukuba.ac.jp (Yasushi Shinjo)
Newsgroups: fj.editor.emacs,fj.comp.input-method
Subject: Anthy Kana with US Keyboard / Backslash problem
Date: 02 Sep 2008 08:21:20 GMT
Organization: Institute of Information Sciences and Electronics, University of
 Tsukuba
Lines: 166
Message-ID: <YAS.08Sep2172120@kirk.is.tsukuba.ac.jp>
NNTP-Posting-Host: kirk.hlla.is.tsukuba.ac.jp
X-Trace: gama.is.tsukuba.ac.jp 1220343579 16387 130.158.83.129 (2 Sep 2008 08:19:39 GMT)
X-Complaints-To: news@gama.is.tsukuba.ac.jp
NNTP-Posting-Date: Tue, 2 Sep 2008 08:19:39 +0000 (UTC)