annotate lisp/mule/kinsoku.el @ 333:4f79e16b1112 r21-0-64

Import from CVS: tag r21-0-64
author cvs
date Mon, 13 Aug 2007 10:49:50 +0200
parents
children 7039e6323819
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
1 ;; kinsoku.el -- Kinsoku (line wrap) processing for XEmacs/Mule
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
2
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
4 ;; This file is part of Mule (MULtilingual Enhancement of XEmacs).
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
5 ;; This file contains Japanese and Chinese characters.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
6
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
7 ;; XEmacs is free software; you can redistribute it and/or modify it
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
8 ;; under the terms of the GNU General Public License as published by
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
9 ;; the Free Software Foundation; either version 2, or (at your option)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
10 ;; any later version.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
11
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
12 ;; XEmacs is distributed in the hope that it will be useful, but
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
13 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
15 ;; General Public License for more details.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
16
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
18 ;; along with XEmacs; see the file COPYING. If not, write to the
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
19 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
20 ;; Boston, MA 02111-1307, USA.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
21
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
22 ;; Written by Jareth Hein (jhod@po.iijnet.or.jp) based off of
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
23 ;; code by S.Tomura, Electrotechnical Lab. (tomura@etl.go.jp) from
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
24 ;; Mule-2.3
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
25
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
26 ;;; Special characters for JIS code
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
27 ;;; "$B!!!"!#!$!%!&!'!'!(!)!*!+!,!-!.!/(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
28 ;;; "$B!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>!?(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
29 ;;; "$B!@!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
30 ;;; "$B!P!Q!R!S!T!U!V!W!X!Y!Z![!\!]!^!_(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
31 ;;; "$B!`!a!b!c!d!e!f!g!h!i!j!k!l!m!n!o(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
32 ;;; "$B!p!q!r!s!t!u!v!w!x!y!z!{!|!}!~(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
33 ;;; "$B"!"""#"$"%"&"'"(")"*"+","-".(B "
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
34 ;;; "$B&!&"&#&$&%&&&'&(&)&*&+&,&-&.&/(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
35 ;;; "$B&0&1&2&3&4&5&6&7&8(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
36 ;;; "$B&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
37 ;;; "$B&P&Q&R&S&T&U&V&W&X(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
38 ;;; "$B'!'"'#'$'%'&'''(')'*'+','-'.'/(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
39 ;;; "$B'0'1'2'3'4'5'6'7'8'9':';'<'='>'?(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
40 ;;; "$B'@'A(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
41 ;;; "$B'Q'R'S'T'U'V'W'X'Y'Z'['\']'^'_!I(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
42 ;;; "$B'`'a'b'c'd'e'f'g'h'i'j'k'l'm'n'o(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
43 ;;; "$B'p'q(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
44 ;;; $B#0#1#2#3#4#5#6#7#8#9#A#B#C#D#E#F(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
45 ;;; "$B$!$#$%$'$)$C$c$e$g$n(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
46 ;;; "$B%!%#%%%'%)%C%c%e%g%n%u%v(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
47
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
48 ;;; Special characters for GB
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
49 ;;;
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
50 ;;; $A!!!"!#!$!%!&!'!(!)!*!+!,!-!.!/(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
51 ;;;$A!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>!?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
52 ;;;$A!@!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
53 ;;;$A!P!Q!R!S!T!U!V!W!X!Y!Z![!\!]!^!_(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
54 ;;;$A!`!a!b!c!d!e!f!g!h!i!j!k!l!m!n!o(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
55 ;;;$A!p!q!r!s!t!u!v!w!x!y!z!{!|!}!~(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
56 ;;; $A"1"2"3"4"5"6"7"8"9":";"<"=">"?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
57 ;;;$A"@"A"B"C"D"E"F"G"H"I"J"K"L"M"N"O(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
58 ;;;$A"P"Q"R"S"T"U"V"W"X"Y"Z"["\"]"^"_(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
59 ;;;$A"`"a"b"c"d"e"f"g"h"i"j"k"l"m"n"o(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
60 ;;;$A"p"q"r"s"t"u"v"w"x"y"z"{"|"}"~(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
61 ;;; $A#!#"###$#%#&#'#(#)#*#+#,#-#.#/(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
62 ;;;$A#0#1#2#3#4#5#6#7#8#9#:#;#<#=#>#?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
63 ;;;$A#@#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
64 ;;;$A#P#Q#R#S#T#U#V#W#X#Y#Z#[#\#]#^#_(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
65 ;;;$A#`#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
66 ;;;$A#p#q#r#s#t#u#v#w#x#y#z#{#|#}#~(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
67 ;;; $A$!$"$#$$$%$&$'$($)$*$+$,$-$.$/(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
68 ;;;$A$0$1$2$3$4$5$6$7$8$9$:$;$<$=$>$?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
69 ;;;$A$@$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
70 ;;;$A$P$Q$R$S$T$U$V$W$X$Y$Z$[$\$]$^$_(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
71 ;;;$A$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
72 ;;;$A$p$q$r$s$t$u$v$w$x$y$z${$|$}$~(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
73 ;;; $A%!%"%#%$%%%&%'%(%)%*%+%,%-%.%/(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
74 ;;;$A%0%1%2%3%4%5%6%7%8%9%:%;%<%=%>%?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
75 ;;;$A%@%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
76 ;;;$A%P%Q%R%S%T%U%V%W%X%Y%Z%[%\%]%^%_(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
77 ;;;$A%`%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
78 ;;;$A%p%q%r%s%t%u%v%w%x%y%z%{%|%}%~(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
79 ;;; $A&!&"&#&$&%&&&'&(&)&*&+&,&-&.&/(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
80 ;;;$A&0&1&2&3&4&5&6&7&8&9&:&;&<&=&>&?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
81 ;;;$A&@&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
82 ;;;$A&P&Q&R&S&T&U&V&W&X&Y&Z&[&\&]&^&_(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
83 ;;;$A&`&a&b&c&d&e&f&g&h&i&j&k&l&m&n&o(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
84 ;;;$A&p&q&r&s&t&u&v&w&x&y&z&{&|&}&~(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
85 ;;; $A'!'"'#'$'%'&'''(')'*'+','-'.'/(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
86 ;;;$A'0'1'2'3'4'5'6'7'8'9':';'<'='>'?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
87 ;;;$A'@'A'B'C'D'E'F'G'H'I'J'K'L'M'N'O(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
88 ;;;$A'P'Q'R'S'T'U'V'W'X'Y'Z'['\']'^'_(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
89 ;;;$A'`'a'b'c'd'e'f'g'h'i'j'k'l'm'n'o(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
90 ;;;$A'p'q'r's't'u'v'w'x'y'z'{'|'}'~(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
91 ;;; $A(!("(#($(%(&('((()(*(+(,(-(.(/(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
92 ;;;$A(0(1(2(3(4(5(6(7(8(9(:(;(<(=(>(?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
93 ;;;$A(@(A(B(C(D(E(F(G(H(I(J(K(L(M(N(O(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
94 ;;;$A(P(Q(R(S(T(U(V(W(X(Y(Z([(\(](^(_(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
95 ;;;$A(`(a(b(c(d(e(f(g(h(i(j(k(l(m(n(o(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
96
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
97 ;;; Special characters for BIG5
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
98 ;;;
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
99 ;;; $(0!!!"!#!$!%!&!'!(!)!*!+!,!-!.!/(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
100 ;;;$(0!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>!?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
101 ;;;$(0!@!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
102 ;;;$(0!P!Q!R!S!T!U!V!W!X!Y!Z![!\!]!^!_(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
103 ;;;$(0!`!a!b!c!d!e!f!g!h!i!j!k!l!m!n!o(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
104 ;;;$(0!p!q!r!s!t!u!v!w!x!y!z!{!|!}!~(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
105 ;;; $(0"!"""#"$"%"&"'"(")"*"+","-"."/(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
106 ;;;$(0"0"1"2"3"4"5"6"7"8"9":";"<"=">"?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
107 ;;;$(0"@"A"B"C"D"E"F"G"H"I"J"K"L"M"N"O(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
108 ;;;$(0"P"Q"R"S"T"U"V"W"X"Y"Z"["\"]"^"_(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
109 ;;;$(0"`"a"b"c"d"e"f"g"h"i"j"k"l"m"n"o(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
110 ;;;$(0"p"q"r"s"t"u"v"w"x"y"z"{"|"}"~(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
111 ;;; $(0#!#"###$#%#&#'#(#)#*#+#,#-#.#/(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
112 ;;;$(0#0#1#2#3#4#5#6#7#8#9#:#;#<#=#>#?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
113 ;;;$(0#@#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
114 ;;;$(0#P#Q#R#S#T#U#V#W#X#Y#Z#[#\#]#^#_(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
115 ;;;$(0#`#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
116 ;;;$(0#p#q#r#s#t#u#v#w#x#y#z#{#|#}#~(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
117 ;;; $(0$!$"$#$$$%$&$'$($)$*$+$,$-$.$/(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
118 ;;;$(0$0$1$2$3$4$5$6$7$8$9$:$;$<$=$>$?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
119 ;;;$(0$@$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
120 ;;;$(0$P$Q$R$S$T$U$V$W$X$Y$Z$[$\$]$^$_(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
121 ;;;$(0$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
122 ;;;$(0$p$q$r$s$t$u$v$w$x$y$z${$|$}$~(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
123 ;;; $(0%!%"%#%$%%%&%'%(%)%*%+%,%-%.%/(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
124 ;;;$(0%0%1%2%3%4%5%6%7%8%9%:%;%<%=%>%?(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
125
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
126 (defvar kinsoku-ascii nil "Do kinsoku-processing for ASCII.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
127 (make-variable-buffer-local 'kinsoku-ascii)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
128 (set-default 'kinsoku-ascii nil)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
129 (defvar kinsoku-jis t "Do kinsoku-processing for JISX0208.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
130 (make-variable-buffer-local 'kinsoku-jis)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
131 (set-default 'kinsoku-jis t)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
132 (defvar kinsoku-gb t "Do kinsoku-processing for GB2312.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
133 (make-variable-buffer-local 'kinsoku-gb)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
134 (set-default 'kinsoku-gb t)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
135 (defvar kinsoku-big5 t "Do kinsoku-processing for Big5..")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
136 (make-variable-buffer-local 'kinsoku-big5)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
137 (set-default 'kinsoku-big5 t)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
138
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
139 (defvar kinsoku-ascii-bol "!)-_~}]:;',.?" "BOL kinsoku for ASCII.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
140 (defvar kinsoku-ascii-eol "({[" "EOL kinsoku for ASCII.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
141 (defvar kinsoku-jis-bol
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
142 (concat "$B!"!#!$!%!&!'!(!)!*!+!,!-!.!/!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
143 "$B!?!@!A!B!C!D!E!G!I!K!M!O!Q!S!U!W!Y![!k!l!m!n(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
144 "$B$!$#$%$'$)$C$c$e$g$n%!%#%%%'%)%C%c%e%g%n%u%v(B")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
145 "BOL kinsoku for JISX0208.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
146 (defvar kinsoku-jis-eol
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
147 "$B!F!H!J!L!N!P!R!T!V!X!Z!k!l!m!n!w!x(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
148 "EOL kinsoku for JISX0208.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
149 (defvar kinsoku-gb-bol
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
150 (concat "$A!"!##.#,!$!%!&!'!(!)!*!+!,!-!/!1#)!3!5!7!9!;!=(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
151 "$A!?#;#:#?#!!@!A!B!C!c!d!e!f#/#\#"#_#~#|(e(B")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
152 "BOL kinsoku for GB2312.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
153 (defvar kinsoku-gb-eol
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
154 (concat "$A!.!0#"#(!2!4!6!8!:!<!>!c!d!e#@!f!l(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
155 "$A(E(F(G(H(I(J(K(L(M(N(O(P(Q(R(S(T(U(V(W(X(Y(h(B")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
156 "EOL kinsoku for GB2312.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
157 (defvar kinsoku-big5-bol
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
158 (concat "$(0!"!#!$!%!&!'!(!)!*!+!,!-!.!/!0!1!2(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
159 "$(0!3!4!5!6!7!8!9!:!;!<!=!?!A!C!E!G!I!K(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
160 "$(0!M!O!Q(B $(0!S!U!W!Y![!]!_!a!c!e!g!i!k!q(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
161 "$(0"#"$"%"&"'"(")"*"+","2"3"4"j"k"l"x%7(B")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
162 "BOL kinsoku for BIG5.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
163 (defvar kinsoku-big5-eol
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
164 (concat "$(0!>!@!B!D!F!H!J!L!N!P!R!T!V!X!Z!\!^!`!b(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
165 "$(0!d!f!h!j!k!q!p"i"j"k"n"x$u$v$w$x$y$z${(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
166 "$(0$|$}$~%!%"%#%$%%%&%'%(%)%*%+%:(B")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
167 "EOL kinsoku for BIG5.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
168
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
169 (define-category ?s "Kinsoku forbidden start of line characters")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
170 (define-category ?e "Kinsoku forbidden end of line characters")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
171
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
172 ;; kinsoku ascii
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
173 (loop for char in (string-to-char-list kinsoku-ascii-bol)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
174 do (modify-category-entry char ?s))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
175 (loop for char in kinsoku-ascii-eol
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
176 do (modify-category-entry char ?e))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
177 ;; kinsoku-jis
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
178 (loop for char in (string-to-char-list kinsoku-jis-bol)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
179 do (modify-category-entry char ?s))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
180 (loop for char in (string-to-char-list kinsoku-jis-eol)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
181 do (modify-category-entry char ?e))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
182 ;; kinsoku-gb
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
183 (loop for char in kinsoku-gb-bol
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
184 do (modify-category-entry char ?s))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
185 (loop for char in kinsoku-gb-eol
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
186 do (modify-category-entry char ?e))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
187 ;; kinsoku-big5
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
188 (loop for char in kinsoku-big5-bol
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
189 do (modify-category-entry char ?s))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
190 (loop for char in kinsoku-big5-eol
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
191 do (modify-category-entry char ?e))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
192
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
193 (defun kinsoku-bol-p ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
194 "Check if point would break forbidden beginning-of-line rules
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
195 Uses category \'s\' to check.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
196 point$B$G2~9T$9$k$H9TF,6XB'$K?($l$k$+$I$&$+$r$+$($9!#(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
197 $B9TF,6XB'J8;z$O(B\'s\'$B$N(Bcategory$B$G;XDj$9$k!#(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
198 (let ((ch (char-after)))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
199 (if (and ch
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
200 (or
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
201 (and kinsoku-ascii (char-in-category-p ch ?a))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
202 (and kinsoku-jis (char-in-category-p ch ?j))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
203 (and kinsoku-gb (char-in-category-p ch ?c))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
204 (and kinsoku-big5 (char-in-category-p ch ?t))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
205 (char-in-category-p ch ?s)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
206 nil)))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
207
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
208 (defun kinsoku-eol-p ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
209 "Check if point would break forbidden end-of-line rules
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
210 Uses category \'e\' to check.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
211 point$B$G2~9T$9$k$H9TKv6XB'$K?($l$k$+$I$&$+$r$+$($9!#(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
212 $B9TKv6XB'J8;z$O(B\'s\'$B$N(Bcategory$B$G;XDj$9$k!#(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
213 (let ((ch (char-before)))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
214 (if (and ch
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
215 (or
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
216 (and kinsoku-ascii (char-in-category-p ch ?a))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
217 (and kinsoku-jis (char-in-category-p ch ?j))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
218 (and kinsoku-gb (char-in-category-p ch ?c))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
219 (and kinsoku-big5 (char-in-category-p ch ?t))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
220 (char-in-category-p ch ?e)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
221 nil)))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
222
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
223 (defvar kinsoku-extend-limit nil
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
224 "Defines how many characters kinsoku will search forward before giving up.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
225 A value of nil equates to infinity.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
226 $B6XB'=hM}$G9T$r?-$P$7$FNI$$H>3QJ8;z?t$r;XDj$9$k!#(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
227 $BHsIi@0?t0J30$N>l9g$OL58BBg$r0UL#$9$k!#(B")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
228
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
229 (defun kinsoku-process ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
230 "Move to a point that will not break forbidden line break rules.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
231 $B6XB'$K?($l$J$$E@$X0\F0$9$k!#(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
232 point$B$,9TF,6XB'$K?($l$k>l9g$O9T$r?-$P$7$F!"6XB'$K?($l$J$$E@$rC5$9!#(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
233 point$B$,9TKv6XB'$K?($l$k>l9g$O9T$r=L$a$F!"6XB'$K?($l$J$$E@$rC5$9!#(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
234 $B$?$@$7!"9T?-$P$7H>3QJ8;z?t$,(Bkinsoku-extend-limit$B$r1[$($k$H!"(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
235 $B9T$r=L$a$F6XB'$K?($l$J$$E@$rC5$9!#(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
236 (let ((bol-kin nil) (eol-kin nil))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
237 (if (and (not (bolp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
238 (not (eolp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
239 (or (setq bol-kin (kinsoku-bol-p))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
240 (setq eol-kin (kinsoku-eol-p))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
241 (cond(bol-kin (kinsoku-process-extend))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
242 (eol-kin (kinsoku-process-shrink))))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
243
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
244 (defun kinsoku-process-extend ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
245 "Move point forward to a permissable for line-breaking.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
246 $B9T$r?-$P$7$F6XB'$K?($l$J$$E@$X0\F0$9$k!#(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
247 (let ((max-column (+ fill-column
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
248 (if (and (numberp kinsoku-extend-limit)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
249 (>= kinsoku-extend-limit 0))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
250 kinsoku-extend-limit
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
251 10000))) ;;; 10000 is deliberatly unreasonably large
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
252 ch1 ch2)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
253 (while (and (setq ch1 (char-after))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
254 (<= (+ (current-column)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
255 (char-width ch1 ))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
256 max-column)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
257 (not (bolp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
258 (not (eolp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
259 (or (kinsoku-eol-p)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
260 (kinsoku-bol-p)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
261 ;;; don't break in the middle of an English word
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
262 (and (char-in-category-p ch1 ?a)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
263 (setq ch2 (char-before))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
264 (char-in-category-p ch2 ?a)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
265 (= ?w (char-syntax ch2))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
266 (= ?w (char-syntax ch1)))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
267 (forward-char))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
268 (if (or (kinsoku-eol-p) (kinsoku-bol-p))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
269 (kinsoku-process-shrink))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
270
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
271 (defun kinsoku-process-shrink ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
272 "Move point backward to a point permissable for line-breaking.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
273 $B9T$r=L$a$F6XB'$K?($l$J$$E@$X0\F0$9$k!#(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
274 (let (ch1 ch2)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
275 (while (and (not (bolp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
276 (not (eolp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
277 (or (kinsoku-bol-p)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
278 (kinsoku-eol-p)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
279 ;;; don't break in the middle of an English word
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
280 (and
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
281 (char-in-category-p (setq ch1 (following-char)) ?a)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
282 (char-in-category-p (setq ch2 (preceding-char)) ?a)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
283 (= ?w (char-syntax ch2))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
284 (= ?w (char-syntax ch1)))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
285 (backward-char))))