;;; skk-auto.el --- $BAw$j2>L>$N<+F0=hM}$N$?$a$N%W%m%0%i%`(B;; Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,;; 1999;; Masahiko Sato <masahiko@kuis.kyoto-u.ac.jp>;; Author: Masahiko Sato <masahiko@kuis.kyoto-u.ac.jp>;; Maintainer: Mikio Nakajima <minakaji@osaka.email.ne.jp>;; Version: $Id$;; Keywords: japanese;; Last Modified: $Date$;; This file is part of SKK.;; SKK is free software; you can redistribute it and/or modify;; it under the terms of the GNU General Public License as published by;; the Free Software Foundation; either versions 2, or (at your option);; any later version.;; SKK is distributed in the hope that it will be useful;; but WITHOUT ANY WARRANTY; without even the implied warranty of;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the;; GNU General Public License for more details.;; You should have received a copy of the GNU General Public License;; along with SKK, see the file COPYING. If not, write to the Free;; Software Foundation Inc., 59 Temple Place - Suite 330, Boston,;; MA 02111-1307, USA.;;; Commentary:;;; Code:(eval-when-compile(require'skk))(require'skk-foreword);;;###autoload(defgroupskk-autonil"SKK auto okuri process related customization.":prefix"skk-":group'skk);;; user variables(defcustomskk-okuri-search-function'skk-okuri-search-subr-original"*skk-okuri-search $B$G;HMQ$9$k4X?t!#(B":type'function:group'skk-auto)(defcustomskk-auto-load-hooknil"*skk-auto.el $B$r%m!<%I$7$?8e$K%3!<%k$5$l$k%U%C%/!#(B":type'hook:group'skk-auto);;;###autoload(defunskk-okuri-search();; skk-auto-okuri-process $B$,(B non-nil $B$J$i$P(B "Uresii" $B$N$h$&$KAw$j2>L>$b4^$a(B;; $B$F%?%$%W$7$F$bAw$j$"$j$N(B "$B4r$7$$(B" $B$rC5$7=P$9!#(B(if(andskk-auto-okuri-process(not(orskk-abbrev-modeskk-process-okuri-earlyskk-henkan-okurigana));; we don't do auto-okuri-process if henkan key contains numerals.(not(skk-numeric-p))(>(lengthskk-henkan-key)skk-kanji-len))(let(l)(setqskk-okuri-index-min(lengthskk-henkan-list)l(funcallskk-okuri-search-function)skk-okuri-index-max(+skk-okuri-index-min(lengthl)))l)))(defunskk-okuri-search-subr-original();; skk-okuri-search $B$N%5%V%k!<%A%s!#8+$D$1$?%(%s%H%j$N%j%9%H$rJV$9!#(B(let*((henkan-keyskk-henkan-key)(key(substringhenkan-key0skk-kanji-len))(len(lengthhenkan-key))(key1(concat"\n"key))key2len2key3len3okuri3;; case-fold-search $B$O!"<-=q%P%C%U%!$G$O>o$K(B nil$B!#(B;;case-fold-search(inhibit-quitt)key-cand-alistpqr)(save-match-data(with-current-buffer(skk-get-jisyo-bufferskk-jisyo)(goto-charskk-okuri-ari-min)(while(search-forwardkey1skk-okuri-ari-maxt)(setqp(point)key2(concatkey(buffer-substring-no-propertiesp(-(search-forward" ")2)))len2(lengthkey2))(if(not(and(<=len2len)(string=key2(substringhenkan-key0len2))))nil(let((contt))(skk-save-point(end-of-line)(setqq(point)))(while(andcont(search-forward"/["qt))(setqr(point))(setqokuri3(buffer-substring-no-propertiesr(1-(search-forward"/")))key3(concatkey2okuri3)len3(lengthkey3))(if(not(and(<=len3len)(string=key3(substringhenkan-key0len3))))nil;; finally found a candidate!(let((okuri(concatokuri3(substringhenkan-keylen3len)))cand)(while(not(eq(following-char)?\]))(setqcand(concat(buffer-substring-no-properties(point)(1-(search-forward"/"skk-okuri-ari-maxt)))okuri));; $B8+=P$78l$,0c$C$F$b8uJd$,F1$8$3$H$,$"$jF@$k!#(B;; $B$+$s(Bz /$B46(B/[$B$8(B/$B46(B/]/;; $B$+$s(Bj /$B46(B/[$B$8(B/$B46(B/]/;; $B$J$I!#(B(if(null(rassoccandkey-cand-alist))(setqkey-cand-alist(cons(conskey3cand)key-cand-alist))));; it is not necessary to seach for "\[" on this line;; any more(setqcontnil)))))));; key3 $B$ND9$$$b$N=g$K%=!<%H$7$FJV$9!#(B(mapcar(function(lambda(x)(cdrx)))(sort(nreversekey-cand-alist)(function(lambda(xy)(string<(cary)(carx))))))))));;;###autoload(defunskk-adjust-search-prog-list-for-auto-okuri();; skk-auto-okuri-process $B$,(B nil $B$G$"$l$P!"(Bskk-search-prog-list $B$+$i(B;; '(skk-okuri-search) $B$r>C$7!"(Bnon-nil $B$G$"$l$P2C$($k!#(B;;;; '(skk-okuri-search) $B$r2C$($k0LCV$K$D$$$F$O!"(Bskk-jisyo $B$N8e$,:GNI$+$I$&$+(B;; $B$OJ,$i$J$$$N$G!"%*%W%7%g%s$GJQ99$G$-$k$h$&$K$9$Y$-$@$,(B...$B!#(B(if(notskk-auto-okuri-process)(setqskk-search-prog-list(delete'(skk-okuri-search)skk-search-prog-list))(if(null(member'(skk-okuri-search)skk-search-prog-list))(let((plskk-search-prog-list)(n0)dicmark)(whilepl(setqdic(carpl))(if(memq(nth1dic)'(skk-jisyoskk-rdbms-private-jisyo-table))(setqmarknplnil)(setqpl(cdrpl)n(1+n))))(skk-splice-inskk-search-prog-list(1+mark)'((skk-okuri-search)))))));;(add-hook 'skk-mode-hook 'skk-adjust-search-prog-list-for-auto-okuri)(run-hooks'skk-auto-load-hook)(provide'skk-auto);;; skk-auto.el ends here