From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#50865: 28.0.50; Emoji with emoji modifier in Linux console garbles emacs display Date: Mon, 04 Oct 2021 16:15:45 +0300 Message-ID: <837det6ida.fsf@gnu.org> References: <87y27cdglm.fsf@sange.fi> <83czooeulj.fsf@gnu.org> <87v92gddcg.fsf@sange.fi> <83bl48eoqk.fsf@gnu.org> <87sfxkd976.fsf@sange.fi> <8335pkeivj.fsf@gnu.org> <831r53d764.fsf@gnu.org> <87v92d564s.fsf@sange.fi> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9891"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50865@debbugs.gnu.org To: Aura Kelloniemi Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 04 15:22:29 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mXNvI-0002GC-BA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Oct 2021 15:22:28 +0200 Original-Received: from localhost ([::1]:32950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXNvH-0004wf-Dc for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Oct 2021 09:22:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXNq2-00083x-Ch for bug-gnu-emacs@gnu.org; Mon, 04 Oct 2021 09:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52621) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXNq1-0000t5-Vt for bug-gnu-emacs@gnu.org; Mon, 04 Oct 2021 09:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mXNq1-00030z-Rg for bug-gnu-emacs@gnu.org; Mon, 04 Oct 2021 09:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Oct 2021 13:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50865 X-GNU-PR-Package: emacs Original-Received: via spool by 50865-submit@debbugs.gnu.org id=B50865.163335336511517 (code B ref 50865); Mon, 04 Oct 2021 13:17:01 +0000 Original-Received: (at 50865) by debbugs.gnu.org; 4 Oct 2021 13:16:05 +0000 Original-Received: from localhost ([127.0.0.1]:35934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXNp7-0002zh-60 for submit@debbugs.gnu.org; Mon, 04 Oct 2021 09:16:05 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXNp5-0002yb-G5 for 50865@debbugs.gnu.org; Mon, 04 Oct 2021 09:16:04 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53006) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXNoz-0000Bu-OO; Mon, 04 Oct 2021 09:15:57 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3299 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXNoz-00033k-83; Mon, 04 Oct 2021 09:15:57 -0400 In-Reply-To: <87v92d564s.fsf@sange.fi> (message from Aura Kelloniemi on Mon, 04 Oct 2021 15:25:23 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:216352 Archived-At: > From: Aura Kelloniemi > Cc: 50865@debbugs.gnu.org > Date: Mon, 04 Oct 2021 15:25:23 +0300 > > The solution of modifying char-width-table at least worked very well for me. > Of course I am intetrested in the things that will break, if I use it, but > most likely those will be smaller annoyances than a garbled display. > > I can document this hack on emacs wiki, if nothing else can be done. I don't recommend documenting such a "solution", because char-width-table affects more than just the display of wide characters, it also affects Lisp programs that use string-width and similar functions. > > Emacs relies on the terminal to display characters correctly, using 2 > > columns (with padding by empty space) when the character is > > double-width. If the terminal doesn't live up to these expectations, > > the display will become garbled. > > Couldn't emacs add a padding space after every two-column character. It could, but for which characters and under what conditions? Who can produce a full comprehensive description of the problems related to character width that are inherent in the Linux console? Anyway, patches to cater to the Linux console will be welcome, if someone can come up with a method to DTRT. The problem is that the changes will need to be on the C level, where we currently simply use fwrite to output the (UTF-8) encoded text to the device. Padding would mean we'd need to write it character by character, or introduce some logic that looks for the problematic characters and outputs them specially. > Emacs already kind of adds a padding space if I type characters one at a time > (because it repositions the cursor after every command) No, Emacs doesn't add any padding when it writes to the terminal, at least AFAICS. It simply relies on the terminal to produce a 2-column glyph for a wide character, and positions the cursor accordingly. Positioning the cursor doesn't in general write a space to the device, it just outputs a terminfo sequence for cursor addressing.