annotate lisp/mule/kinsoku.el @ 1315:70921960b980

[xemacs-hg @ 2003-02-20 08:19:28 by ben] check in makefile fixes et al Makefile.in.in: Major surgery. Move all stuff related to building anything in the src/ directory into src/. Simplify the dependencies -- everything in src/ is dependent on the single entry `src' in MAKE_SUBDIRS. Remove weirdo targets like `all-elc[s]', dump-elc[s], etc. mule/mule-msw-init.el: Removed. Delete this file. mule/mule-win32-init.el: New file, with stuff from mule-msw-init.el -- not just for MS Windows native, boys and girls! bytecomp.el: Change code inserted to catch trying to load a Mule-only .elc file in a non-Mule XEmacs. Formerly you got the rather cryptic "The required feature `mule' cannot be provided". Now you get "Loading this file requires Mule support". finder.el: Remove dependency on which directory this function is invoked from. update-elc.el: Don't mess around with ../src/BYTECOMPILE_CHANGE. Now that Makefile.in.in and xemacs.mak are in sync, both of them use NEEDTODUMP and the other one isn't used. dumped-lisp.el: Rewrite in terms of `list' and `nconc' instead of assemble-list, so we can have arbitrary forms, not just `when-feature'. very-early-lisp.el: Nuke this file. finder-inf.el, packages.el, update-elc.el, update-elc-2.el, loadup.el, make-docfile.el: Eliminate references to very-early-lisp. msw-glyphs.el: Comment clarification. xemacs.mak: Add macros DO_TEMACS, DO_XEMACS, and a few others; this macro section is now completely in sync with src/Makefile.in.in. Copy check-features, load-shadows, and rebuilding finder-inf.el from src/Makefile.in.in. The main build/dump/recompile process is now synchronized with src/Makefile.in.in. Change `WARNING' to `NOTE' and `error checking' to `error-checking' TO avoid tripping faux warnings and errors in the VC++ IDE. Makefile.in.in: Major surgery. Move all stuff related to building anything in the src/ directory from top-level Makefile.in.in to here. Simplify the dependencies. Rearrange into logical subsections. Synchronize the main compile/dump/build-elcs section with xemacs.mak, which is already clean and in good working order. Remove weirdo targets like `all-elc[s]', dump-elc[s], etc. Add additional levels of macros \(e.g. DO_TEMACS, DO_XEMACS, TEMACS_BATCH, XEMACS_BATCH, XEMACS_BATCH_PACKAGES) to factor out duplicated stuff. Clean up handling of "HEAP_IN_DATA" (Cygwin) so it doesn't need to ignore the return value from dumping. Add .NO_PARALLEL since various aspects of building and dumping must be serialized but do not always have dependencies between them (this is impossible in some cases). Everything related to src/ now gets built in one pass in this directory by just running `make' (except the Makefiles themselves and config.h, paths.h, Emacs.ad.h, and other generated .h files). console.c: Update list of possibly valid console types. emacs.c: Rationalize the specifying and handling of the type of the first frame. This was originally prompted by a workspace in which I got GTK to compile under C++ and in the process fixed it so it could coexist with X in the same build -- hence, a combined TTY/X/MS-Windows/GTK build is now possible under Cygwin. (However, you can't simultaneously *display* more than one kind of device connection -- but getting that to work is not that difficult. Perhaps a project for a bored grad student. I (ben) would do it but don't see the use.) To make sense of this, I added new switches that can be used to specifically indicate the window system: -x [aka --use-x], -tty \[aka --use-tty], -msw [aka --use-ms-windows], -gtk [aka --use-gtk], and -gnome [aka --use-gnome, same as --use-gtk]. -nw continues as an alias for -tty. When none have been given, XEmacs checks for other parameters implying particular device types (-t -> tty, -display -> x [or should it have same treatment as DISPLAY below?]), and has ad-hoc logic afterwards: if env var DISPLAY is set, use x (or gtk? perhaps should check whether gnome is running), else MS Windows if it exsits, else TTY if it exists, else stream, and you must be running in batch mode. This also fixes an existing bug whereby compiling with no x, no mswin, no tty, when running non- interactively (e.g. to dump) I get "sorry, must have TTY support". emacs.c: Turn on Vstack_trace_on_error so that errors are debuggable even when occurring extremely early in reinitialization. emacs.c: Try to make sure that the user can see message output under Windows (i.e. it doesn't just disappear right away) regardless of when it occurs, e.g. in the middle of creating the first frame. emacs.c: Define new function `emacs-run-status', indicating whether XEmacs is noninteractive or interactive, whether raw, post-dump/pdump-load or run-temacs, whether we are dumping, whether pdump is in effect. event-stream.c: It's "mommas are fat", not "momas are fat". Fix other typo. event-stream.c: Conditionalize in_menu_callback check on HAVE_MENUBARS, because it won't exist on w/o menubar support, lisp.h: More hackery on RETURN_NOT_REACHED. Cygwin v3.2 DOES complain here if RETURN_NOT_REACHED() is blank, as it is for GCC 2.5+. So make it blank only for GCC 2.5 through 2.999999999999999. Declare Vstack_trace_on_error. profile.c: Need to include "profile.h" to fix warnings. sheap.c: Don't fatal() when need to rerun Make, just stderr_out() and exit(0). That way we can distinguish between a dumping failing expectedly (due to lack of stack space, triggering another dump) and unexpectedly, in which case, we want to stop building. (or go on, if -K is given) syntax.c, syntax.h: Use ints where they belong, and enum syntaxcode's where they belong, and fix warnings thereby. syntax.h: Fix crash caused by an edge condition in the syntax-cache macros. text.h: Spacing fixes. xmotif.h: New file, to get around shadowing warnings. EmacsManager.c, event-Xt.c, glyphs-x.c, gui-x.c, input-method-motif.c, xmmanagerp.h, xmprimitivep.h: Include xmotif.h. alloc.c: Conditionalize in_malloc on ERROR_CHECK_MALLOC. config.h.in, file-coding.h, fileio.c, getloadavg.c, select-x.c, signal.c, sysdep.c, sysfile.h, systime.h, text.c, unicode.c: Eliminate HAVE_WIN32_CODING_SYSTEMS, use WIN32_ANY instead. Replace defined (WIN32_NATIVE) || defined (CYGWIN) with WIN32_ANY. lisp.h: More futile attempts to walk and chew gum at the same time when dealing with subr's that don't return.
author ben
date Thu, 20 Feb 2003 08:19:44 +0000
parents aa5bf79c0076
children cd167465bf69 91b3aa59f49b
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))
908
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
175 (loop for char in (string-to-list kinsoku-ascii-eol)
333
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
908
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
183 (loop for char in (string-to-list kinsoku-gb-bol)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
184 do (modify-category-entry char ?s))
908
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
185 (loop for char in (string-to-list kinsoku-gb-eol)
333
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
908
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
188 (loop for char in (string-to-list kinsoku-big5-bol)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
189 do (modify-category-entry char ?s))
908
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
190 (loop for char in (string-to-list kinsoku-big5-eol)
333
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"
908
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
198 (let ((before (char-before))
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
199 (after (char-after)))
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
200 (if (and after
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
201 (or
908
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
202 (and kinsoku-ascii (char-in-category-p after ?a))
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
203 (and kinsoku-jis (or (char-in-category-p after ?j)
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
204 (and before
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
205 (char-in-category-p before ?j))))
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
206 (and kinsoku-gb (or (char-in-category-p after ?c)
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
207 (and before
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
208 (char-in-category-p before ?c))))
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
209 (and kinsoku-big5 (or (char-in-category-p after ?t)
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
210 (and before
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
211 (char-in-category-p before ?t))))))
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
212 (char-in-category-p after ?s)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
213 nil)))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
214
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
215 (defun kinsoku-eol-p ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
216 "Check if point would break forbidden end-of-line rules
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
217 Uses category \'e\' to check.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
218 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
219 $B9TKv6XB'J8;z$O(B\'s\'$B$N(Bcategory$B$G;XDj$9$k!#(B"
908
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
220 (let ((before (char-before))
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
221 (after (char-after)))
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
222 (if (and before
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
223 (or
908
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
224 (and kinsoku-ascii (char-in-category-p before ?a))
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
225 (and kinsoku-jis (or (char-in-category-p before ?j)
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
226 (and after
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
227 (char-in-category-p after ?j))))
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
228 (and kinsoku-gb (or (char-in-category-p before ?c)
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
229 (and after
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
230 (char-in-category-p after ?c))))
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
231 (and kinsoku-big5 (or (char-in-category-p before ?t)
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
232 (and after
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
233 (char-in-category-p after ?t))))))
aa5bf79c0076 [xemacs-hg @ 2002-07-09 09:36:53 by stephent]
stephent
parents: 771
diff changeset
234 (char-in-category-p before ?e)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
235 nil)))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
236
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
237 (defvar kinsoku-extend-limit nil
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
238 "Defines how many characters kinsoku will search forward before giving up.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
239 A value of nil equates to infinity.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
240 $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
241 $BHsIi@0?t0J30$N>l9g$OL58BBg$r0UL#$9$k!#(B")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
242
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
243 (defun kinsoku-process ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
244 "Move to a point that will not break forbidden line break rules.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
245 $B6XB'$K?($l$J$$E@$X0\F0$9$k!#(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
246 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
247 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
248 $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
249 $B9T$r=L$a$F6XB'$K?($l$J$$E@$rC5$9!#(B"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
250 (let ((bol-kin nil) (eol-kin nil))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
251 (if (and (not (bolp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
252 (not (eolp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
253 (or (setq bol-kin (kinsoku-bol-p))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
254 (setq eol-kin (kinsoku-eol-p))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
255 (cond(bol-kin (kinsoku-process-extend))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
256 (eol-kin (kinsoku-process-shrink))))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
257
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
258 (defun kinsoku-process-extend ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
259 "Move point forward to a permissable for line-breaking.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
260 $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
261 (let ((max-column (+ fill-column
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
262 (if (and (numberp kinsoku-extend-limit)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
263 (>= kinsoku-extend-limit 0))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
264 kinsoku-extend-limit
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
265 10000))) ;;; 10000 is deliberatly unreasonably large
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
266 ch1 ch2)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
267 (while (and (setq ch1 (char-after))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
268 (<= (+ (current-column)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
269 (char-width ch1 ))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
270 max-column)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
271 (not (bolp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
272 (not (eolp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
273 (or (kinsoku-eol-p)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
274 (kinsoku-bol-p)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
275 ;;; don't break in the middle of an English word
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
276 (and (char-in-category-p ch1 ?a)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
277 (setq ch2 (char-before))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
278 (char-in-category-p ch2 ?a)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
279 (= ?w (char-syntax ch2))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
280 (= ?w (char-syntax ch1)))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
281 (forward-char))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
282 (if (or (kinsoku-eol-p) (kinsoku-bol-p))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
283 (kinsoku-process-shrink))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
284
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
285 (defun kinsoku-process-shrink ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
286 "Move point backward to a point permissable for line-breaking.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
287 $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
288 (let (ch1 ch2)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
289 (while (and (not (bolp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
290 (not (eolp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
291 (or (kinsoku-bol-p)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
292 (kinsoku-eol-p)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
293 ;;; don't break in the middle of an English word
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
294 (and
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
295 (char-in-category-p (setq ch1 (following-char)) ?a)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
296 (char-in-category-p (setq ch2 (preceding-char)) ?a)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
297 (= ?w (char-syntax ch2))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
298 (= ?w (char-syntax ch1)))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
299 (backward-char))))