emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Word wrap for non-whitespace-seperated language


From: Yuan Fu
Subject: Word wrap for non-whitespace-seperated language
Date: Wed, 4 Mar 2020 13:39:34 -0500

Emacs word wrap tries to only wrap at whitespace and tabs; that doesn’t work well when I mix, say, Chinese with English: since Chinese doesn’t have spaces between words, Emacs couldn’t find whitespaces to wrap a line, and it could happen that the line is wrapped very early, far from the right fringe. For example:

中英文混排中英文混排中英文混排中英文混排中英文混排中英文混排中英文混排中英文混排中英文混
排中英文混排中英文混排中英文混排 English English
中英文混排中英文混排中英文混排中英文混排中英文混排中英文混排中英文混排中英文混排中英文混

The ideal wrapping is

中英文混排中英文混排中英文混排中英文混排中英文混排中英文混排中英文混排中英文混排中英文混
排中英文混排中英文混排中英文混排 English English 中英文混排中英文混排中英文混排中英
文混排中英文混排中英文混排中英文混排中英文混排中英文混

It would be nice if word wrap knows when to wrap on whitespaces and when to simply wrap between characters. Is the wrapping feature implemented in redisplay engine? Or in lisp? The word-wrap variable is defined in buffer.c but I didn’t find the word wrap code in buffer.c. If it’s in lisp maybe I can hack on it.

Yuan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]