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.devel Subject: Re: "Final" version of tty child frames Date: Wed, 23 Oct 2024 10:28:05 +0300 Message-ID: <86y12fe0sa.fsf@gnu.org> References: <87cyjrjz74.fsf@163.com> <87zfmvpkki.fsf@163.com> <87v7xjpjoi.fsf@163.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29332"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tumashu@163.com, emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 23 09:28:44 2024 Return-path: Envelope-to: ged-emacs-devel@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 1t3VnQ-0007Oy-5U for ged-emacs-devel@m.gmane-mx.org; Wed, 23 Oct 2024 09:28:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3Vmw-0004Nl-5g; Wed, 23 Oct 2024 03:28:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3Vms-0004NU-1x for emacs-devel@gnu.org; Wed, 23 Oct 2024 03:28:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3Vmq-0006wC-W2; Wed, 23 Oct 2024 03:28:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=xJl07M2qi9BuDYSvdB4pKthOSGtRmac05A5PYMbBpNo=; b=KYptqv+N94hIdI3O1712 Bwywvm3kEIbYYvaJShbg7IVmGIM1I0ms5UDdPEgqONbmgNBcxDHtO/DMPxd3wPh+Zg/QQo271C0Tf lu8PF5lyjp7eHmmDjf45NN03AAHXDs5NtOMB/DWsqNhvAfSF1Pv0Oa7G6dNwRyXrzttttTzl4cnrE jj/gjzm7JciP5tIdLVdvVTh1J414MVnMSWSDfi4rDrAetaurEJvpaTmlAHQ0HMVkMXoUrV3xVDwBf 9uNqV+j+Prq81RXeLewea0nD0XV3wFQHUfuW/3SXNLDOh2jh2ggR5IbWCYpPLrbNPRFktF8cmfIEU BFA9RA4e59joBg==; In-Reply-To: (message from Gerd =?utf-8?Q?M?= =?utf-8?Q?=C3=B6llmann?= on Wed, 23 Oct 2024 06:40:11 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:324768 Archived-At: > From: Gerd Möllmann > Cc: Emacs Devel > Date: Wed, 23 Oct 2024 06:40:11 +0200 > > Gerd Möllmann writes: > > > Feng Shu writes: > > > >> Gerd Möllmann writes: > >> > >>> Feng Shu writes: > >>> > >>>> border do not work well when current buffer is CJK, maybe because CJK > >>>> Char width is not 1 > >>> > >>> Could you please send me a bit of CJK text so that I have something I > >>> can test this with? > > > > Thanks! > > Hm, okay, but not sure how to fix that. > > The problem comes indeed from the root frame displaying characters that > are more then 1 column wide, say N. When we output such a character to > the terminal, the cursor moves by N columns. Emacs represents that in > the glyph matrix by producing N glyphs for the character, all bu tthe > first have a padding flag set. So we have > > ... (C, 0) (C, 1) ... > > in the glpyh matrix, where C is the character, and the number is the > padding flag. > > Now assume, for example, that the child frame is posititoned so that its > left border where we want to display a '|' is in the column for the (C, > 1). > > That can't work, because writing C to the terminal moves 2 columns and > will skip over the column where we want the '|' to appear. I think the solution should be the same as what we do when a line needs to wrap (i.e. be continued) and we don't have enough columns to put all the N glyphs before the continuation glyph: we don't show the entire N-glyph group. IOW, the border glyph should be shown instead of multi-column character, padded with enough spaces before it to make up for the M < N glyphs of C that could be shown before the border. In your example above, C will not be shown, and instead we will show one space glyph followed by the '|' glyph.