annotate lisp/mule/kinsoku.el @ 814:a634e3b7acc8

[xemacs-hg @ 2002-04-14 12:41:59 by ben] latest changes TODO.ben-mule-21-5: Update. make-docfile.c: Add basic support for handling ISO 2022 doc strings -- we parse the basic charset designation sequences so we know whether we're in ASCII and have to pay attention to end quotes and such. Reformat code according to coding standards. abbrev.el: Add `global-abbrev-mode', which turns on or off abbrev-mode in all buffers. Added `defining-abbrev-turns-on-abbrev-mode' -- if non-nil, defining an abbrev through an interactive function will automatically turn on abbrev-mode, either globally or locally depending on the command. This is the "what you'd expect" behavior. indent.el: general function for indenting a balanced expression in a mode-correct way. Works similar to indent-region in that a mode can specify a specific command to do the whole operation; if not, figure out the region using forward-sexp and indent each line using indent-according-to-mode. keydefs.el: Removed. Modify M-C-backslash to do indent-region-or-balanced-expression. Make S-Tab just insert a TAB char, like it's meant to do. make-docfile.el: Now that we're using the call-process-in-lisp, we need to load an extra file win32-native.el because we're running a bare temacs. menubar-items.el: Totally redo the Cmds menu so that most used commands appear directly on the menu and less used commands appear in submenus. The old way may have been very pretty, but rather impractical. process.el: Under Windows, don't ever use old-call-process-internal, even in batch mode. We can do processes in batch mode. subr.el: Someone recoded truncate-string-to-width, saying "the FSF version is too complicated and does lots of hard-to-understand stuff" but the resulting recoded version was *totally* wrong! it misunderstood the basic point of this function, which is work in *columns* not chars. i dumped ours and copied the version from FSF 21.1. Also added truncate-string-with-continuation-dots, since this idiom is used often. config.inc.samp, xemacs.mak: Separate out debug and optimize flags. Remove all vestiges of USE_MINIMAL_TAGBITS, USE_INDEXED_LRECORD_IMPLEMENTATION, and GUNG_HO, since those ifdefs have long been removed. Make error-checking support actually work. Some rearrangement of config.inc.samp to make it more logical. Remove callproc.c and ntproc.c from xemacs.mak, no longer used. Make pdump the default. lisp.h: Add support for strong type-checking of Bytecount, Bytebpos, Charcount, Charbpos, and others, by making them classes, overloading the operators to provide integer-like operation and carefully controlling what operations are allowed. Not currently enabled in C++ builds because there are still a number of compile errors, and it won't really work till we merge in my "8-bit-Mule" workspace, in which I make use of the new types Charxpos, Bytexpos, Memxpos, representing a "position" either in a buffer or a string. (This is especially important in the extent code.) abbrev.c, alloc.c, eval.c, buffer.c, buffer.h, editfns.c, fns.c, text.h: Warning fixes, some of them related to new C++ strict type checking of Bytecount, Charbpos, etc. dired.c: Caught an actual error due to strong type checking -- char len being passed when should be byte len. alloc.c, backtrace.h, bytecode.c, bytecode.h, eval.c, sysdep.c: Further optimize Ffuncall: -- process arg list at compiled-function creation time, converting into an array for extra-quick access at funcall time. -- rewrite funcall_compiled_function to use it, and inline this function. -- change the order of check for magic stuff in SPECBIND_FAST_UNSAFE to be faster. -- move the check for need to garbage collect into the allocation code, so only a single flag needs to be checked in funcall. buffer.c, symbols.c: add debug funs to check on mule optimization info in buffers and strings. eval.c, emacs.c, text.c, regex.c, scrollbar-msw.c, search.c: Fix evil crashes due to eistrings not properly reinitialized under pdump. Redo a bit some of the init routines; convert some complex_vars_of() into simple vars_of(), because they didn't need complex processing. callproc.c, emacs.c, event-stream.c, nt.c, process.c, process.h, sysdep.c, sysdep.h, syssignal.h, syswindows.h, ntproc.c: Delete. Hallelujah, praise the Lord, there is no god but Allah!!! fix so that processes can be invoked in bare temacs -- thereby eliminating any need for callproc.c. (currently only eliminated under NT.) remove all crufty and unnecessary old process code in ntproc.c and elsewhere. move non-callproc-specific stuff (mostly environment) into process.c, so callproc.c can be left out under NT. console-tty.c, doc.c, file-coding.c, file-coding.h, lstream.c, lstream.h: fix doc string handling so it works with Japanese, etc docs. change handling of "character mode" so callers don't have to manually set it (quite error-prone). event-msw.c: spacing fixes. lread.c: eliminate unused crufty vintage-19 "FSF defun hack" code. lrecord.h: improve pdump description docs. buffer.c, ntheap.c, unexnt.c, win32.c, emacs.c: Mule-ize some unexec and startup code. It was pseudo-Mule-ized before by simply always calling the ...A versions of functions, but that won't cut it -- eventually we want to be able to run properly even if XEmacs has been installed in a Japanese directory. (The current problem is the timing of the loading of the Unicode tables; this will eventually be fixed.) Go through and fix various other places where the code was not Mule-clean. Provide a function mswindows_get_module_file_name() to get our own name without resort to PATH_MAX and such. Add a big comment in main() about the problem with Unicode table load timing that I just alluded to. emacs.c: When error-checking is enabled (interpreted as "user is developing XEmacs"), don't ask user to "pause to read messages" when a fatal error has occurred, because it will wedge if we are in an inner modal loop (typically when a menu is popped up) and make us unable to get a useful stack trace in the debugger. text.c: Correct update_entirely_ascii_p_flag to actually work. lisp.h, symsinit.h: declarations for above changes.
author ben
date Sun, 14 Apr 2002 12:43:31 +0000
parents 943eaba38521
children aa5bf79c0076
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 333
diff changeset
1 ;; kinsoku.el -- Kinsoku (line wrap) processing for XEmacs/Mule -*- coding: iso-2022-7bit; -*-
333
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
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 502
diff changeset
173 (loop for char in (string-to-list kinsoku-ascii-bol)
333
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
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 502
diff changeset
178 (loop for char in (string-to-list kinsoku-jis-bol)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
179 do (modify-category-entry char ?s))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 502
diff changeset
180 (loop for char in (string-to-list kinsoku-jis-eol)
333
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))))