annotate lisp/mule/kinsoku.el @ 826:6728e641994e

[xemacs-hg @ 2002-05-05 11:30:15 by ben] syntax cache, 8-bit-format, lots of code cleanup README.packages: Update info about --package-path. i.c: Create an inheritable event and pass it on to XEmacs, so that ^C can be handled properly. Intercept ^C and signal the event. "Stop Build" in VC++ now works. bytecomp-runtime.el: Doc string changes. compat.el: Some attempts to redo this to make it truly useful and fix the "multiple versions interacting with each other" problem. Not yet done. Currently doesn't work. files.el: Use with-obsolete-variable to avoid warnings in new revert-buffer code. xemacs.mak: Split up CFLAGS into a version without flags specifying the C library. The problem seems to be that minitar depends on zlib, which depends specifically on libc.lib, not on any of the other C libraries. Unless you compile with libc.lib, you get errors -- specifically, no _errno in the other libraries, which must make it something other than an int. (#### But this doesn't seem to obtain in XEmacs, which also uses zlib, and can be linked with any of the C libraries. Maybe zlib is used differently and doesn't need errno, or maybe XEmacs provides an int errno; ... I don't understand. Makefile.in.in: Fix so that packages are around when testing. abbrev.c, alloc.c, buffer.c, buffer.h, bytecode.c, callint.c, casefiddle.c, casetab.c, casetab.h, charset.h, chartab.c, chartab.h, cmds.c, console-msw.h, console-stream.c, console-x.c, console.c, console.h, data.c, device-msw.c, device.c, device.h, dialog-msw.c, dialog-x.c, dired-msw.c, dired.c, doc.c, doprnt.c, dumper.c, editfns.c, elhash.c, emacs.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, events.c, events.h, extents.c, extents.h, faces.c, file-coding.c, file-coding.h, fileio.c, fns.c, font-lock.c, frame-gtk.c, frame-msw.c, frame-x.c, frame.c, frame.h, glade.c, glyphs-gtk.c, glyphs-msw.c, glyphs-msw.h, glyphs-x.c, glyphs.c, glyphs.h, gui-msw.c, gui-x.c, gui.h, gutter.h, hash.h, indent.c, insdel.c, intl-win32.c, intl.c, keymap.c, lisp-disunion.h, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, marker.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, mule-ccl.c, mule-charset.c, mule-coding.c, mule-wnnfns.c, nas.c, objects-msw.c, objects-x.c, opaque.c, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, process.h, profile.c, rangetab.c, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-x.c, redisplay.c, redisplay.h, regex.c, regex.h, scrollbar-msw.c, search.c, select-x.c, specifier.c, specifier.h, symbols.c, symsinit.h, syntax.c, syntax.h, syswindows.h, tests.c, text.c, text.h, tooltalk.c, ui-byhand.c, ui-gtk.c, unicode.c, win32.c, window.c: Another big Ben patch. -- FUNCTIONALITY CHANGES: add partial support for 8-bit-fixed, 16-bit-fixed, and 32-bit-fixed formats. not quite done yet. (in particular, needs functions to actually convert the buffer.) NOTE: lots of changes to regex.c here. also, many new *_fmt() inline funs that take an Internal_Format argument. redo syntax cache code. make the cache per-buffer; keep the cache valid across calls to functions that use it. also keep it valid across insertions/deletions and extent changes, as much as is possible. eliminate the junky regex-reentrancy code by passing in the relevant lisp info to the regex routines as local vars. add general mechanism in extents code for signalling extent changes. fix numerous problems with the case-table implementation; yoshiki never properly transferred many algorithms from old-style to new-style case tables. redo char tables to support a default argument, so that mapping only occurs over changed args. change many chartab functions to accept Lisp_Object instead of Lisp_Char_Table *. comment out the code in font-lock.c by default, because font-lock.el no longer uses it. we should consider eliminating it entirely. Don't output bell as ^G in console-stream when not a TTY. add -mswindows-termination-handle to interface with i.c, so we can properly kill a build. add more error-checking to buffer/string macros. add some additional buffer_or_string_() funs. -- INTERFACE CHANGES AFFECTING MORE CODE: switch the arguments of write_c_string and friends to be consistent with write_fmt_string, which must have printcharfun first. change BI_* macros to BYTE_* for increased clarity; similarly for bi_* local vars. change VOID_TO_LISP to be a one-argument function. eliminate no-longer-needed CVOID_TO_LISP. -- char/string macro changes: rename MAKE_CHAR() to make_emchar() for slightly less confusion with make_char(). (The former generates an Emchar, the latter a Lisp object. Conceivably we should rename make_char() -> wrap_char() and similarly for make_int(), make_float().) Similar changes for other *CHAR* macros -- we now consistently use names with `emchar' whenever we are working with Emchars. Any remaining name with just `char' always refers to a Lisp object. rename macros with XSTRING_* to string_* except for those that reference actual fields in the Lisp_String object, following conventions used elsewhere. rename set_string_{data,length} macros (the only ones to work with a Lisp_String_* instead of a Lisp_Object) to set_lispstringp_* to make the difference clear. try to be consistent about caps vs. lowercase in macro/inline-fun names for chars and such, which wasn't the case before. we now reserve caps either for XFOO_ macros that reference object fields (e.g. XSTRING_DATA) or for things that have non-function semantics, e.g. directly modifying an arg (BREAKUP_EMCHAR) or evaluating an arg (any arg) more than once. otherwise, use lowercase. here is a summary of most of the macros/inline funs changed by all of the above changes: BYTE_*_P -> byte_*_p XSTRING_BYTE -> string_byte set_string_data/length -> set_lispstringp_data/length XSTRING_CHAR_LENGTH -> string_char_length XSTRING_CHAR -> string_emchar INTBYTE_FIRST_BYTE_P -> intbyte_first_byte_p INTBYTE_LEADING_BYTE_P -> intbyte_leading_byte_p charptr_copy_char -> charptr_copy_emchar LEADING_BYTE_* -> leading_byte_* CHAR_* -> EMCHAR_* *_CHAR_* -> *_EMCHAR_* *_CHAR -> *_EMCHAR CHARSET_BY_ -> charset_by_* BYTE_SHIFT_JIS* -> byte_shift_jis* BYTE_BIG5* -> byte_big5* REP_BYTES_BY_FIRST_BYTE -> rep_bytes_by_first_byte char_to_unicode -> emchar_to_unicode valid_char_p -> valid_emchar_p Change intbyte_strcmp -> qxestrcmp_c (duplicated functionality). -- INTERFACE CHANGES AFFECTING LESS CODE: use DECLARE_INLINE_HEADER in various places. remove '#ifdef emacs' from XEmacs-only files. eliminate CHAR_TABLE_VALUE(), which duplicated the functionality of get_char_table(). add BUFFER_TEXT_LOOP to simplify iterations over buffer text. define typedefs for signed and unsigned types of fixed sizes (INT_32_BIT, UINT_32_BIT, etc.). create ALIGN_FOR_TYPE as a higher-level interface onto ALIGN_SIZE; fix code to use it. add charptr_emchar_len to return the text length of the character pointed to by a ptr; use it in place of charcount_to_bytecount(..., 1). add emchar_len to return the text length of a given character. add types Bytexpos and Charxpos to generalize Bytebpos/Bytecount and Charbpos/Charcount, in code (particularly, the extents code and redisplay code) that works with either kind of index. rename redisplay struct params with names such as `charbpos' to e.g. `charpos' when they are e.g. a Charxpos, not a Charbpos. eliminate xxDEFUN in place of DEFUN; no longer necessary with changes awhile back to doc.c. split up big ugly combined list of EXFUNs in lisp.h on a file-by-file basis, since other prototypes are similarly split. rewrite some "*_UNSAFE" macros as inline funs and eliminate the _UNSAFE suffix. move most string code from lisp.h to text.h; the string code and text.h code is now intertwined in such a fashion that they need to be in the same place and partially interleaved. (you can't create forward references for inline funs) automated/lisp-tests.el, automated/symbol-tests.el, automated/test-harness.el: Fix test harness to output FAIL messages to stderr when in batch mode. Fix up some problems in lisp-tests/symbol-tests that were causing spurious failures.
author ben
date Sun, 05 May 2002 11:33:57 +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))))