unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#29364: 27.0.50; Word Wrap doesn't support CJK
@ 2017-11-20 12:34 Chunyang Xu
  2017-11-20 18:22 ` Eli Zaretskii
  2021-02-04 14:05 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 3+ messages in thread
From: Chunyang Xu @ 2017-11-20 12:34 UTC (permalink / raw)
  To: 29364

Hello.

For example, here is some Chinese text:

文字文字 English 文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字。

in Emacs, turn on Word Wrap via M-x visual-line-mode and adjust window
width (e.g., 87), Emacs displays it as:

---------------------------------------------------------------------------------------
文字文字 English
文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文
字。
---------------------------------------------------------------------------------------

but it should display:

---------------------------------------------------------------------------------------
文字文字 English 文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文
字文字文字文字文字。
---------------------------------------------------------------------------------------

the point is, Chinese doesn't have to rely on space to break, it can
break at anywhere but with some exceptions, such as, after breaking, the
punctuation mark can not be at the beginning of the line, so the
following is also incorrect:

-----------------------------------------------------
文字文字 English 文字文字文字文字文字文字文字文字文字
文字文字文字文字文字文字文字文字文字文字文字文字文字
。
-----------------------------------------------------

for this width, it should display:

-----------------------------------------------------
文字文字 English 文字文字文字文字文字文字文字文字文字
文字文字文字文字文字文字文字文字文字文字文字文字文
字。
-----------------------------------------------------

\f
Some applications such as Chrome (web browser) and Atom (text edit) can
wrap CJK text, and Atom added CJK wrapping support by this patch:

- https://github.com/atom/atom/pull/9162

There is an article from Wikipedia explaining how to break CJK text:

- https://en.wikipedia.org/wiki/Line_breaking_rules_in_East_Asian_languages

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#29364: 27.0.50; Word Wrap doesn't support CJK
  2017-11-20 12:34 bug#29364: 27.0.50; Word Wrap doesn't support CJK Chunyang Xu
@ 2017-11-20 18:22 ` Eli Zaretskii
  2021-02-04 14:05 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2017-11-20 18:22 UTC (permalink / raw)
  To: Chunyang Xu; +Cc: 29364

> From: Chunyang Xu <mail@xuchunyang.me>
> Date: Mon, 20 Nov 2017 20:34:48 +0800
> 
> the point is, Chinese doesn't have to rely on space to break, it can
> break at anywhere but with some exceptions, such as, after breaking, the
> punctuation mark can not be at the beginning of the line, so the
> following is also incorrect:
> 
> -----------------------------------------------------
> 文字文字 English 文字文字文字文字文字文字文字文字文字
> 文字文字文字文字文字文字文字文字文字文字文字文字文字
> 。
> -----------------------------------------------------
> 
> for this width, it should display:
> 
> -----------------------------------------------------
> 文字文字 English 文字文字文字文字文字文字文字文字文字
> 文字文字文字文字文字文字文字文字文字文字文字文字文
> 字。
> -----------------------------------------------------
> 
> \f
> Some applications such as Chrome (web browser) and Atom (text edit) can
> wrap CJK text, and Atom added CJK wrapping support by this patch:
> 
> - https://github.com/atom/atom/pull/9162
> 
> There is an article from Wikipedia explaining how to break CJK text:
> 
> - https://en.wikipedia.org/wiki/Line_breaking_rules_in_East_Asian_languages

Emacs has an implementation of those rules in kinsoku.el.  Word-wrap
is done on the C level in the display engine; volunteers are welcome
to submit patches for honoring Kinsoku rules on that level.  The
challenge is to do so without slowing down redisplay.

Thanks.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#29364: 27.0.50; Word Wrap doesn't support CJK
  2017-11-20 12:34 bug#29364: 27.0.50; Word Wrap doesn't support CJK Chunyang Xu
  2017-11-20 18:22 ` Eli Zaretskii
@ 2021-02-04 14:05 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-04 14:05 UTC (permalink / raw)
  To: Chunyang Xu; +Cc: 29364

Chunyang Xu <mail@xuchunyang.me> writes:

> For example, here is some Chinese text:
>
> 文字文字 English 文字文字文字文字文字文字文字文字文字文字文字文字文字
> 文字文字文字文字文字文字文字文字文字。
>
> in Emacs, turn on Word Wrap via M-x visual-line-mode and adjust window
> width (e.g., 87), Emacs displays it as:
>
> ---------------------------------------------------------------------------------------
> 文字文字 English
> 文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文
> 字文字文字文字文
> 字。

This has been fixed in Emacs 28.  You can now say
(setq word-wrap-by-category t) to make Emacs respect kinsoku rules when
wrapping lines visually.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-04 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-20 12:34 bug#29364: 27.0.50; Word Wrap doesn't support CJK Chunyang Xu
2017-11-20 18:22 ` Eli Zaretskii
2021-02-04 14:05 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).