unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Word wrap for non-whitespace-seperated language
@ 2020-03-04 18:39 Yuan Fu
  2020-03-04 18:44 ` Eli Zaretskii
  0 siblings, 1 reply; 24+ messages in thread
From: Yuan Fu @ 2020-03-04 18:39 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1352 bytes --]

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



[-- Attachment #2: Type: text/html, Size: 2332 bytes --]

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

end of thread, other threads:[~2020-03-09 20:11 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-04 18:39 Word wrap for non-whitespace-seperated language Yuan Fu
2020-03-04 18:44 ` Eli Zaretskii
2020-03-04 18:51   ` Yuan Fu
2020-03-04 19:16     ` Eli Zaretskii
2020-03-04 20:34       ` Yuan Fu
2020-03-05  4:42         ` Eli Zaretskii
2020-03-05 22:33           ` Yuan Fu
2020-03-05 22:46             ` Drew Adams
2020-03-05 22:50             ` Yuan Fu
2020-03-06  2:18               ` Yuan Fu
2020-03-07  4:23             ` Richard Stallman
2020-03-07  5:04               ` Yuan Fu
2020-03-07  8:19                 ` Eli Zaretskii
2020-03-07 17:30                   ` Yuan Fu
2020-03-09  2:52                     ` Richard Stallman
2020-03-08  6:16                 ` Richard Stallman
2020-03-08 15:04                   ` Yuan Fu
2020-03-09  2:50                     ` Richard Stallman
2020-03-09 15:44                       ` Yuan Fu
2020-03-09 17:20                         ` Eli Zaretskii
2020-03-09 20:11                           ` Yuan Fu
2020-03-07  8:22               ` Eli Zaretskii
2020-03-07  8:40                 ` Lars Ingebrigtsen
2020-03-07 10:50                   ` Eli Zaretskii

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).