0

For a given Chinese character, C-u C-x = (what-cursor-position DETAIL) says

category: .:Base, C:2-byte han, L:Strong L2R, c:Chinese, j:Japanese, |:line breakable

How can I remove the 'line breakable' property for all the thousands of Chinese characters, except for the fullwidth punctuation characters? And for the fullwidth punctuation characters, make the line breakable property apply only after the character, not before?

Yes, I want to test this for How to break CJK only after punctuation, not between characters?

0

1 Answer 1

1

C-h f modify-category-entry says:

modify-category-entry is a primitive-function in ‘src/category.c’.

(modify-category-entry CHARACTER CATEGORY &optional TABLE RESET)

Modify the category set of CHARACTER by adding CATEGORY to it.
The category is changed only for table TABLE, which defaults to
the current buffer’s category table.
CHARACTER can be either a single character or a cons representing the
lower and upper ends of an inclusive character range to modify.
CATEGORY must be a category name (a character between ‘ ’ and ‘~’).
Use ‘describe-categories’ to see existing category names.
If optional fourth argument RESET is non-nil,
then delete CATEGORY from the category set instead of adding it.

  Probably introduced at or before Emacs version 23.1.

See how it is used in lisp/international/characters.el:128-155:

;; Deal with the CJK charsets first.  Since the syntax of blocks is
;; defined per charset, and the charsets may contain e.g. Latin
;; characters, we end up with the wrong syntax definitions if we're
;; not careful.

;; Chinese characters (Unicode)
(modify-category-entry '(#x2E80 . #x312F) ?|)
(modify-category-entry '(#x3190 . #x33FF) ?|)
(modify-category-entry '(#x3400 . #x4DB5) ?C)
(modify-category-entry '(#x4E00 . #x9FD5) ?C)
(modify-category-entry '(#x3400 . #x9FD5) ?c)
(modify-category-entry '(#x3400 . #x9FD5) ?|)
(modify-category-entry '(#xF900 . #xFAFF) ?C)
(modify-category-entry '(#xF900 . #xFAFF) ?c)
(modify-category-entry '(#xF900 . #xFAFF) ?|)
(modify-category-entry '(#x1B170 . #x1B2FF) ?c)
(modify-category-entry '(#x20000 . #x2FFFF) ?|)
(modify-category-entry '(#x20000 . #x2FFFF) ?C)
(modify-category-entry '(#x20000 . #x2FFFF) ?c)

This answers the first question, I think (although I have not tested anything: caveat emptor). I have no idea about the before/after question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.