aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2006-10-23 01:56:24 +0000
committerKenichi Handa2006-10-23 01:56:24 +0000
commitbc2ec97dfbf9919e83c6cb4c36f4bd451817bcd5 (patch)
treeafb9436b5436200313993fc6c627d035667899d8
parent60d0b84b7369044087799eaa9ec3010d0280b1ec (diff)
downloademacs-bc2ec97dfbf9919e83c6cb4c36f4bd451817bcd5.tar.gz
emacs-bc2ec97dfbf9919e83c6cb4c36f4bd451817bcd5.zip
Don't use charset property
`fill-find-break-point-function'. (fill-find-break-point-function-table): New variable. (fill-find-break-point): Lookup fill-find-break-point-function-table.
-rw-r--r--lisp/textmodes/fill.el33
1 files changed, 15 insertions, 18 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 514350119fe..4558331b29f 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -368,15 +368,18 @@ and `fill-nobreak-invisible'."
368 (looking-at paragraph-start)))) 368 (looking-at paragraph-start))))
369 (run-hook-with-args-until-success 'fill-nobreak-predicate))))) 369 (run-hook-with-args-until-success 'fill-nobreak-predicate)))))
370 370
371;; Put `fill-find-break-point-function' property to charsets which 371(defvar fill-find-break-point-function-table
372;; require special functions to find line breaking point. 372 (let ((table (make-char-table nil)))
373(dolist (pair '((katakana-jisx0201 . kinsoku) 373 ;; Register `kinsoku' for scripts HAN, KANA, BOPOMPFO, and CJK-MISS.
374 (chinese-gb2312 . kinsoku) 374 (map-char-table #'(lambda (key val)
375 (japanese-jisx0208 . kinsoku) 375 (if (memq val '(han kana bopomofo cjk-misc))
376 (japanese-jisx0212 . kinsoku) 376 (set-char-table-range table key 'kinsoku)))
377 (chinese-big5-1 . kinsoku) 377 char-script-table)
378 (chinese-big5-2 . kinsoku))) 378 ;; Register `kinsoku" also for full width characters.
379 (put-charset-property (car pair) 'fill-find-break-point-function (cdr pair))) 379 (set-char-table-range table '(#xFF01 . #xFF61) 'kinsoku)
380 (set-char-table-range table '(#xFFE0 . #xFFE6) 'kinsoku)
381 table)
382 "Char-table of special functions to find line breaking point.")
380 383
381(defun fill-find-break-point (limit) 384(defun fill-find-break-point (limit)
382 "Move point to a proper line breaking position of the current line. 385 "Move point to a proper line breaking position of the current line.
@@ -387,15 +390,9 @@ after or before a non-ASCII character. If the charset of the
387character has the property `fill-find-break-point-function', this 390character has the property `fill-find-break-point-function', this
388function calls the property value as a function with one arg LINEBEG. 391function calls the property value as a function with one arg LINEBEG.
389If the charset has no such property, do nothing." 392If the charset has no such property, do nothing."
390 (let* ((ch (following-char)) 393 (let ((func (or
391 (charset (char-charset ch)) 394 (aref fill-find-break-point-function-table (following-char))
392 func) 395 (aref fill-find-break-point-function-table (preceding-char)))))
393 (if (eq charset 'ascii)
394 (setq ch (preceding-char)
395 charset (char-charset ch)))
396 (if (charsetp charset)
397 (setq func
398 (get-charset-property charset 'fill-find-break-point-function)))
399 (if (and func (fboundp func)) 396 (if (and func (fboundp func))
400 (funcall func limit)))) 397 (funcall func limit))))
401 398