comparison lisp/international/kinsoku.el @ 17759:ef12c80a8a1e

Set category of kinsoku-bol and kinsoku-eol for latin-jisx0201 and katakana-jisx0201 characters.
author Kenichi Handa <handa@m17n.org>
date Mon, 12 May 1997 06:56:23 +0000
parents 70194012fb3a
children 8b4a66c66dd6
comparison
equal deleted inserted replaced
17758:8c67c2e2cc29 17759:ef12c80a8a1e
44 ;; placed at beginning of line. 44 ;; placed at beginning of line.
45 (let* ((kinsoku-bol 45 (let* ((kinsoku-bol
46 (concat 46 (concat
47 ;; ASCII 47 ;; ASCII
48 "!)-_~}]:;',.?" 48 "!)-_~}]:;',.?"
49 ;; Latin JISX0201
50 ;; Instead of putting Latin JISX0201 string directyly, we
51 ;; generate the string as below to avoid character
52 ;; unification problem.
53 (let* ((str1 "!)-_~}]:;',.?")
54 (len (length str1))
55 (idx 0)
56 (str2 "")
57 ch)
58 (while (< idx len)
59 (setq ch (make-char 'latin-jisx0201 (aref str1 idx))
60 str2 (concat str2 (char-to-string ch))
61 idx (1+ idx)))
62 str2)
63 ;; Katakana JISX0201
64 "(I!#'()*+,-./0^_(B"
49 ;; Japanese JISX0208 65 ;; Japanese JISX0208
50 "$B!"!#!$!%!&!'!(!)!*!+!,!-!.!/!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>(B\ 66 "$B!"!#!$!%!&!'!(!)!*!+!,!-!.!/!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>(B\
51 $B!?!@!A!B!C!D!E!G!I!K!M!O!Q!S!U!W!Y![!k!l!m!n(B\ 67 $B!?!@!A!B!C!D!E!G!I!K!M!O!Q!S!U!W!Y![!k!l!m!n(B\
52 $B$!$#$%$'$)$C$c$e$g$n%!%#%%%'%)%C%c%e%g%n%u%v(B" 68 $B$!$#$%$'$)$C$c$e$g$n%!%#%%%'%)%C%c%e%g%n%u%v(B"
53 ;; Chinese GB2312 69 ;; Chinese GB2312
70 ;; placed at end of line. 86 ;; placed at end of line.
71 (let* ((kinsoku-eol 87 (let* ((kinsoku-eol
72 (concat 88 (concat
73 ;; ASCII 89 ;; ASCII
74 "({[`" 90 "({[`"
91 ;; Latin JISX0201
92 ;; See the comment above.
93 (let* ((str1 "({[`")
94 (len (length str1))
95 (idx 0)
96 (str2 "")
97 ch)
98 (while (< idx len)
99 (setq ch (make-char 'latin-jisx0201 (aref str1 idx))
100 str2 (concat str2 (char-to-string ch))
101 idx (1+ idx)))
102 str2)
103 ;; JISX0201 Katakana
104 "(I"(B"
75 ;; Japanese JISX0208 105 ;; Japanese JISX0208
76 "$B!F!H!J!L!N!P!R!T!V!X!Z!k!l!m!n!w!x(B\ 106 "$B!F!H!J!L!N!P!R!T!V!X!Z!k!l!m!n!w!x(B\
77 $A!.!0#"#(!2!4!6!8!:!<!>!c!d!e#@!f!l(B" 107 $A!.!0#"#(!2!4!6!8!:!<!>!c!d!e#@!f!l(B"
78 ;; Chinese GB2312 108 ;; Chinese GB2312
79 "$A(E(F(G(H(I(J(K(L(M(N(O(P(Q(R(S(T(U(V(W(X(Y(h(B\ 109 "$A(E(F(G(H(I(J(K(L(M(N(O(P(Q(R(S(T(U(V(W(X(Y(h(B\
99 (if (or (<= kinsoku-limit 0) 129 (if (or (<= kinsoku-limit 0)
100 (< (cdr pos-and-column) (+ (current-fill-column) kinsoku-limit))) 130 (< (cdr pos-and-column) (+ (current-fill-column) kinsoku-limit)))
101 (goto-char (car pos-and-column))))) 131 (goto-char (car pos-and-column)))))
102 132
103 ;; Try to resolve `kinsoku' restriction by making the current line shorter. 133 ;; Try to resolve `kinsoku' restriction by making the current line shorter.
104 ;; The line can't be broken before the buffer position LINEBEG." 134 ;; The line can't be broken before the buffer position LINEBEG.
105 (defun kinsoku-shorter (linebeg) 135 (defun kinsoku-shorter (linebeg)
106 (let ((pos (save-excursion 136 (let ((pos (save-excursion
107 (forward-char -1) 137 (forward-char -1)
108 (while (and (< linebeg (point)) 138 (while (and (< linebeg (point))
109 (or (aref (char-category-set (preceding-char)) ?<) 139 (or (aref (char-category-set (preceding-char)) ?<)