-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lines only stretch half-way when locale is Chinese #25
Comments
Is it just in a terminal, or also in a GUI frame? |
Yeah, the effect is the same. I dug around a bit in page-break-lines' source and found out that |
Hmm, that's frustrating: it means |
I can reproduce this under Korean language environment too. |
That code originally came from @knu, and the rationale was this:
I can't tell if the behaviour in the Chinese locale is an Emacs bug, or expected, but it seems like with the current code there's no obvious way for it to be correct everywhere. |
Does |
@knu It works at least for the separator. Do you know what problem may occur if I use default char width table with CJK languages? |
Altering the char-width-table just for the separator could be a safe option for you, but if you try out the default table for awhile and don't see any trouble, you probably don't need the CJK behavior which CJK users need when dealing with characters from legacy encodings or traditionally used fonts. |
Could you tell me how I can alter the table only for the separators? |
char-width-table is a char-table, so you can manipulate it with the generic char-table functions. I haven't tested this at all, but I think you could do it this way: (let ((table (make-char-table nil))) ;; make a new empty table
(set-char-table-parent table char-width-table) ;; make it inherit from the current char-width-table
(set-char-table-range table page-break-lines-char 1) ;; let the width of page-break-lines-char be 1
(setq char-width-table table)) ;; use the new table as char-width-table |
This is probably the same issue as #24, but since that one's closed, I thought I open a new one.
As it turns out this is caused by running within a Chinese locale. You can reproduce this behaviour by running
env LC_CTYPE=zh_CN.utf-8 emacs
.I guess this could have something to do with double-width characters? Just a guess, though.
The text was updated successfully, but these errors were encountered: