GNU bug report logs - #57607
Feature request: Use the character cell on bottom-right corner of a terminal

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Akib Azmain Turja <akib@HIDDEN>; Done: Gerd Möllmann <gerd.moellmann@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 31.1, send any further explanations to 57607 <at> debbugs.gnu.org and Akib Azmain Turja <akib@HIDDEN> Request was from Gerd Möllmann <gerd.moellmann@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 9 Mar 2025 11:33:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 09 07:33:42 2025
Received: from localhost ([127.0.0.1]:58657 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1trEuc-00080y-D6
	for submit <at> debbugs.gnu.org; Sun, 09 Mar 2025 07:33:42 -0400
Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:43174)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1trEuZ-00080h-8x
 for 57607 <at> debbugs.gnu.org; Sun, 09 Mar 2025 07:33:39 -0400
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5e56b229d60so8014241a12.0
 for <57607 <at> debbugs.gnu.org>; Sun, 09 Mar 2025 04:33:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741520013; x=1742124813; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=N2f2cPnGrA0T52e3peAfTooYWLllcuwGwR+6QNV/8e0=;
 b=SIiSzdMb8s2BypRenMvXwr+X7SR8U6s4aWxdKcX8Bm4lGya4cwua1/A63Cg9GyucVh
 MIE12mw775PzmLRjLnIjOLo4Y8vWCG3WJ6LgM+yTgnvFEuOYGdIv4c/V9UtCFvBsAyK/
 NXL0gc4XgNsDI+P3UBSyJL/A1SufdHflJEOetaFEi6LdJgd33dPQkmXlbAKshcN07oxD
 0V03fOVDEOwBlb9RZB2YDjPle/aw/OXShvLdfqNGjsskBe0mynEJIL6fOcxurKzwA7uj
 n48YI3fKWmQnVUvOvM9Z9tmlN7XORjFGv6BFPQMatRhUBhsKCkHKnXXLHsn8p54D1Wqv
 35SQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741520013; x=1742124813;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=N2f2cPnGrA0T52e3peAfTooYWLllcuwGwR+6QNV/8e0=;
 b=cqmUm4PPLqej9QR9zb1A/dxxk3iEXb16CKOFIOKg3ZJU3fiVPHpzEyE87X2suDxwkn
 9s1s5wavzsyZH/0wgw4kG/OsOTsqeMQUt1+08PBNYJEaYRDNjh/VuSsC+JeeDlnJ9rfk
 vwauBhzfksuLojLBVtu9CxBu0CGgoljW9HxN3nb4B0mgDEP+3qYdTpG4SYhsZNaaaiya
 wFpQuDcijwM/kxT2Ph+WWC6dLZ2oAfOaydzTD1dCz/1eVVv57OvBDF+CBaTAqTxEpEau
 8iCX6eremSMD/NXBlxEpw0COjtPHTnUf+HJW1SsxQyfTzfiOHS2vWHiZLGy6dePpGAwx
 tlYw==
X-Forwarded-Encrypted: i=1;
 AJvYcCXnWgytXgl+C0IFECpCVacweP3kLyJTXYgREWA8S1045hucy15eOMt9wpx5CmXJcWwJbzCmIw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YyUoMQq3xm4Y5qMnd5SDqs8y5b9eJClO0MiHAQ31MaMvrhjl9ye
 NXLVVAcnbh4T7Hsl3maccU0jScwlkwhQkTA5UWH5+M2NcV3I3EBmLsFf/Q==
X-Gm-Gg: ASbGnctpiEYJW9y9uzLVEAKCoM+IMcePRk0rac6TkmUKRyTOZ+KDJb7byW0QitIozMz
 pr6iRK4dtsdnE6FUHuxj+Tdukoywf9PG6X4PDisQEWajQhH7+30J3o01c3FfLc4/85z8so4bee8
 katblZztuEk63S4qeO76xlsTkH0uo1b1NMfw2huzj3M+PIH+E5wUyL+mpdR2WluLlSAGZi8yj4p
 XLLuYxnYmxIgaQ1YjceiKOv8NYPh24CRbkhQtPo8i1JHwasIlAMyqR6T4/hhVUsiPFbBXnl7NkX
 q4F2SplAXv5Rh3vEcx42yPuPbSiE8Zd012HhlbxqE7apQFU3a9IX0Ly0MfzvoFdfRnWej213xoD
 /Dup1pCyHta7N6esguHxzXSBDq1bMeNKcHFzDYBgO0R6Xxz77ciePoQ==
X-Google-Smtp-Source: AGHT+IF1gpJ3hn+6U6wZIOC+XrjeL809cyAW/emvF4MMnwKnw0lxtNcjGkfoqOAg/7k+9TYEMZaw5w==
X-Received: by 2002:a17:906:c4ca:b0:ac1:eeba:f88 with SMTP id
 a640c23a62f3a-ac26ca32540mr570800266b.11.1741520012405; 
 Sun, 09 Mar 2025 04:33:32 -0700 (PDT)
Received: from pro2 (p200300e0b72657006426b18a2c37a3d2.dip0.t-ipconnect.de.
 [2003:e0:b726:5700:6426:b18a:2c37:a3d2])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-ac239736806sm581935466b.114.2025.03.09.04.33.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 09 Mar 2025 04:33:31 -0700 (PDT)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Akib Azmain Turja <akib@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <878rlveo32.fsf@HIDDEN>
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <87r0zpi9za.fsf@HIDDEN> <83y1twwv7w.fsf@HIDDEN>
 <87edvohx2s.fsf@HIDDEN> <83a66cvwob.fsf@HIDDEN>
 <87lepver2e.fsf@HIDDEN> <878rlveo32.fsf@HIDDEN>
Date: Sun, 09 Mar 2025 12:33:30 +0100
Message-ID: <m24j02781h.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: Eli Zaretskii <eliz@HIDDEN>, 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Akib, sorry for effectively loosing this in time. I guess I thought
others would take this up.

I fixed this now in master, in a different form because your patches did
no longer apply due to the new tty child frame stuff. It was easier that
way for me.

And closing.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 7 Oct 2022 19:30:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 07 15:30:15 2022
Received: from localhost ([127.0.0.1]:37417 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ogt31-0004Pb-GS
	for submit <at> debbugs.gnu.org; Fri, 07 Oct 2022 15:30:15 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38204)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ogt2y-0003v0-I6
 for 57607 <at> debbugs.gnu.org; Fri, 07 Oct 2022 15:30:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:52144)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ogt2t-0000jx-9T; Fri, 07 Oct 2022 15:30:07 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=DFJlcOEJkKpZZ5W91iWlN4AtQHLbSAL5YG7x3HnhIMQ=; b=dtfqWH+flz9u
 NG6kHvwn4sIE0qS7JmfU2Qr5I31tbK/bhSX3JFbtrBBYNlQm+pOlXNx/kisISSHbmB+eagh+cYtHo
 yd8yBUJ+IRKTXWIgHzEPPmiLPcQJPuScmrYEyW/mqfhFSP5uMhaGfnvYa+gJcicJJVkpxZCPKbleO
 SyDfO3VrD4Tgh3LAerTY03DEOX61PrMcWuLDCwJYzuXXUhE0Mal0e41sJk+PT4QtwZMSzmCG7BgkF
 Vh68vw0F6SGg7b8d+MnoFnfQ6j7juCyC3wj47tnOIfBNywy6IdO0wtM8C5Sg1ePZ04falMo0acz0P
 PvP5zQUWKUixc7wC+Diflg==;
Received: from [87.69.77.57] (port=3584 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ogt2q-0000PN-5V; Fri, 07 Oct 2022 15:30:06 -0400
Date: Fri, 07 Oct 2022 22:30:03 +0300
Message-Id: <835ygvmnyc.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Akib Azmain Turja <akib@HIDDEN>
In-Reply-To: <87r0zj93v3.fsf@HIDDEN> (message from Akib Azmain Turja on
 Fri, 07 Oct 2022 19:10:08 +0600)
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <87r0zpi9za.fsf@HIDDEN> <83y1twwv7w.fsf@HIDDEN>
 <87edvohx2s.fsf@HIDDEN> <83a66cvwob.fsf@HIDDEN>
 <87lepver2e.fsf@HIDDEN> <83o7urvjdz.fsf@HIDDEN>
 <87r0zj93v3.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57607
Cc: gerd.moellmann@HIDDEN, 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Akib Azmain Turja <akib@HIDDEN>
> Cc: 57607 <at> debbugs.gnu.org,  gerd.moellmann@HIDDEN
> Date: Fri, 07 Oct 2022 19:10:08 +0600
> 
> I just discovered new type of glyph: padding glyph.  What's this?

See the commentary in dispextern.h for the padding_p flag of 'struct
glyph'.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 7 Oct 2022 13:19:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 07 09:19:39 2022
Received: from localhost ([127.0.0.1]:34822 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ognGN-0001zW-9x
	for submit <at> debbugs.gnu.org; Fri, 07 Oct 2022 09:19:39 -0400
Received: from knopi.disroot.org ([178.21.23.139]:51302)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1ognGL-0001zM-IC
 for 57607 <at> debbugs.gnu.org; Fri, 07 Oct 2022 09:19:38 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id F35C54C39E;
 Fri,  7 Oct 2022 15:19:35 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id jbXWlsI_FpY8; Fri,  7 Oct 2022 15:19:34 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1665148483; bh=enjl5P44HS6oj71pKUWOkkzOXllmpWX0gly/IRZ9z1s=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=g4LNQS2e9y6Ni4g8cHIOOt3Bgypig5KTouqfg/0gnJyam5+57qoF74BW6UrTeBqQQ
 HJ6J2JFC1gWXXn/yYSAk46Epb7DxAoqzkB2bgtlATed3Jkk3ZdyUoAWX2pPogh4E7j
 sFrman8q7MUgyz8177PNEveLMMEve8OrfKz3FtG6+QAR5zxjf+6ViLvBqXQ65W5EMB
 o62wY5h08IhL+wVlAEWxO7ZtzXDFPuzsXPsIWus8ac8xhL41iZh/gAeb9hJWLLj61W
 XvuWBSdIi0zx6Awe3tjNLfIkz+DkgQbr0deehmOLrXEXNy7TQqSgaPxvIX4zPuFf+l
 wTzabEktfxatQ==
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <83o7urvjdz.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 04 Oct
 2022 15:54:48 +0300")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <87r0zpi9za.fsf@HIDDEN> <83y1twwv7w.fsf@HIDDEN>
 <87edvohx2s.fsf@HIDDEN> <83a66cvwob.fsf@HIDDEN>
 <87lepver2e.fsf@HIDDEN> <83o7urvjdz.fsf@HIDDEN>
Date: Fri, 07 Oct 2022 19:10:08 +0600
Message-ID: <87r0zj93v3.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: gerd.moellmann@HIDDEN, 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Akib Azmain Turja <akib@HIDDEN>
>> Cc: 57607 <at> debbugs.gnu.org,  gerd.moellmann@HIDDEN
>> Date: Tue, 04 Oct 2022 18:00:57 +0600
>>=20
>> > Please try with some 2-column CJK characters, I'm not sure the example
>> > with ^L is relevant here.  You can find the list of wide characters in
>> > characters.el (search for "width"); for example, characters in the
>> > U+FF00 block can be useful.
>>=20
>> Thanks, "CJK STROKE D" doesn't work as expected, and the result depends
>> on terminal in use.  How can I determine the width of a glyph?
>
> Like this:
>
>   (char-width CHAR)
>
> where CHAR is the character you are interested in.  For example:
>
>   (char-width #x31D4)
>    =3D> 2
>
> From C, you can call char_width, like Fchar_width (which see) does.
>
> One other subtle point: the argument STRING to tty_write_glyphs is a
> string of 'struct glyph' objects, not a string of characters.  Each
> struct glyph has the code of the character to display in its u.ch
> member, if the glyph is a simple character glyph; for the full story
> see encode_terminal_code.

Thanks.

I just discovered new type of glyph: padding glyph.  What's this?  Is
this a nop glyph?  I guess it's used to make string of width N use N
numbers of glyph.  But how?  Is this like [CJK PAD] or [PAD CJK]?

>
>> > (And the existing code could have bugs,
>> > no need to assume it is always correct.)
>>=20
>> Yes, it can, but in most cases, my brain has more bugs.
>
> Indeed, that the existing code has bugs should not be our first
> hypothesis.  But it shouldn't be axiomatic that there are no bugs
> there ;-)
>
>> > face_id is an integer, and zero is a valid value (it means the default
>> > face), so NULL won't do.  But you can use -1 to mean "no face ID".
>> > Just make sure you never pass it to FACE_FROM_ID etc.
>> >
>> > Thanks.
>>=20
>> OK, I'll try that.  Thanks.
>
> TIA

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmNAJTEACgkQVTX89U2I
YWuWvA/8CZmbjfFC5ya5Ff6MPw4+SprSyvFKW+NZWnWno0BX8EoSlXYAjmf+wML0
DbhVU2wfnYV5du4RKOZuHNrpfoO6Q+D1dacimOOv2hGDosKyleTNT+oDlMBnKhas
IcVqHeLvGDM5VB8wXFB+IVy/ZRqz/bBT3vg6XlSxeCv9DuuJZF/inW8/Q8A9Tz8n
c3Hkmz6dTZVwjSxvw9PCkcjQcYpl9++n/eMsgzrgI74MffijsQXGgh6Izu2wiCp1
5GwuyHfKlEgh0W6soeZeFKoydPjb/H7jU+2+wNLRwxRHWa80rvCAUNaNTlf5P5Ia
EmwdRWqCMzweuHhYi+PAZp4ERBAEcvRuqJHoBYKCulkHEy39zc6bDDrV0jycJ8rK
dmSo8nRyt4fUJAIgvc7Ena0il/Hp5bX4A7HkiHhPivJoRSFqrX3kc1fwyuoT/Zg5
OiudNhP3+g9BymxZzyVgxWj84+xhvkbZbZw/rJRPNmlOEut392HzPOpJByTQRNjV
SesxiKzVj/5EIGKe84pQRaDL1vWbhLqTj9d7LePEbr74ZcptYQtj5f82pHj3BX/5
qNBpdVyFKR3PgGCr8MEZMBZEa91giJkqfHGUjHzpNBHtZyXKqj1hC9VfMobhB2fJ
CfWE7lB48GuY0UbbPP8SxGSpI/7jl5d59puLwiMMmB/MUK/427Q=
=OgO6
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 4 Oct 2022 13:07:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 04 09:07:22 2022
Received: from localhost ([127.0.0.1]:52908 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ofhdp-0003r1-BL
	for submit <at> debbugs.gnu.org; Tue, 04 Oct 2022 09:07:22 -0400
Received: from knopi.disroot.org ([178.21.23.139]:54820)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1ofhdl-0003qq-6O
 for 57607 <at> debbugs.gnu.org; Tue, 04 Oct 2022 09:07:19 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id E4F7B4C639;
 Tue,  4 Oct 2022 15:07:15 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with UTF8SMTP id T-UMlYYk80Tt; Tue,  4 Oct 2022 15:07:13 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1664888779; bh=n4SNjnRaInOyUTMwtKKgdAFtj/mZzqLXMv4PXP8DBKc=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=WSCXYX1PxOirMmloXQ2N5afzh6lcwW+72ctZLiBoeNjwQ8CCii2MTS8t2aKOHp6uq
 DRMoInjCn9HkhDO7MPJOE/o9VAsddjhmXWvsN2B9rodD5ny3PF4Bf0MtnR7Ic9D9bo
 cKMSxWMdi4LYl7gVSJXuoUrvNqOINbIq8Tw9UouI5j1Hn5RYcM67mHIhqfyksmhiA7
 3AK2s8zq33wwFnLd8RlOrD2Oj5tFO/ou9JDzeI9+3Gygg7bUWvqqlREYlWB8Gj6uh/
 xOGlu74Idf+0VCQKcLOS8hPfdP+bYRdmPLBEOoepw9EUpjS50+Yt3cZrACwEvMYY+e
 EkVW6GcGo7f4w==
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <87lepver2e.fsf@HIDDEN> (Akib Azmain Turja's message of
 "Tue, 04 Oct 2022 18:00:57 +0600")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <87r0zpi9za.fsf@HIDDEN> <83y1twwv7w.fsf@HIDDEN>
 <87edvohx2s.fsf@HIDDEN> <83a66cvwob.fsf@HIDDEN>
 <87lepver2e.fsf@HIDDEN>
Date: Tue, 04 Oct 2022 19:05:21 +0600
Message-ID: <878rlveo32.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="==-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: gerd.moellmann@HIDDEN, 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--==-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Akib Azmain Turja <akib@HIDDEN> writes:

> Eli Zaretskii <eliz@HIDDEN> writes:
>
>>> From: Akib Azmain Turja <akib@HIDDEN>
>>> Cc: 57607 <at> debbugs.gnu.org,  gerd.moellmann@HIDDEN
>>> Date: Tue, 04 Oct 2022 13:22:51 +0600
>>>=20
>>> > Thanks.  But could you please describe the idea of the patch in some
>>> > comment?  It is hard to follow the code, especially since the diff has
>>> > many pure whitespace changes.
>>>=20
>>> The idea is that you write the string just like before (for example, you
>>> want to write "hello" in a five columns width terminal, so you write
>>> only "hell", so that the line shows "hell "), then move a character
>>> backward and write the last glyph (write "o", so that the line shows
>>> "helo "), move a character backward again and arrange that after writing
>>> the next glyph, the character on the current position will be pushed
>>> towards right and write the glyph before the last one (write "l", now
>>> the line shows "hello").
>>>=20
>>> Should I add the explanation to the function as comment?
>>
>> Yes, please.  It would also help if the respective parts of the code
>> were annotated with comments that explain their role in the algorithm.
>
> OK.

Done.

>
>>
>>> > Also, this:
>>> >
>>> >> +      /* Go to the previous position. */
>>> >> +      cmgoto (tty, curY (tty), curX (tty) - 1);
>>> >> +      cmplus (tty, 1);
>>> >
>>> > Seem to assume the last character takes just one column?  What about
>>> > characters whose width is 2 columns?
>>>=20
>>> Yes, I assume that.  I don't think any multi-char width glyph reach this
>>> function (I think they are converted to single column width glyphs, for
>>> example "^L" is converted to "^" and "L").  The reason of the assumption
>>> is the following code:
>>>=20
>>> --8<---------------cut here---------------start------------->8---
>>>   if (AutoWrap (tty)
>>>       && curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
>>>       && (curX (tty) + len) =3D=3D FRAME_COLS (f))
>>>     len --;
>>> --8<---------------cut here---------------end--------------->8---
>>>=20
>>> Which also assumes the same.
>>
>> Please try with some 2-column CJK characters, I'm not sure the example
>> with ^L is relevant here.  You can find the list of wide characters in
>> characters.el (search for "width"); for example, characters in the
>> U+FF00 block can be useful.
>
> Thanks, "CJK STROKE D" doesn't work as expected, and the result depends
> on terminal in use.  How can I determine the width of a glyph?
>
>> (And the existing code could have bugs,
>> no need to assume it is always correct.)
>
> Yes, it can, but in most cases, my brain has more bugs.
>
>>
>>> > And finally, it would be nice to avoid so much code duplication
>>> > between tty_write_glyphs and tty_write_glyphs_with_face.  Is that
>>> > feasible?
>>>=20
>>> Yes, I think so.  I think it possible to just add a new argument
>>> "face_id" to tty_write_glyphs would the trick.  tty_write_glyph will try
>>> to use "face_id" if it is specified, otherwise fallback to the face_id
>>> in the string.  But how to "not" specify a face_id?  Would a NULL work?
>>
>> face_id is an integer, and zero is a valid value (it means the default
>> face), so NULL won't do.  But you can use -1 to mean "no face ID".
>> Just make sure you never pass it to FACE_FROM_ID etc.
>>
>> Thanks.
>
> OK, I'll try that.  Thanks.

Done.  Looks like Emacs still works.  Here are the patches:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-Write-on-the-bottom-right-character-cell-on-terminal.patch
Content-Transfer-Encoding: quoted-printable
Content-Description: PATCH 1/2

From=2072af00d8610bdc194062b246aab0e38f22174aeb Mon Sep 17 00:00:00 2001
From: Akib Azmain Turja <akib@HIDDEN>
Date: Mon, 3 Oct 2022 14:18:59 +0600
Subject: [PATCH 1/2] Write on the bottom-right character cell on terminal

Correctly write on the bottom-right character cell on text terminals
if the terminal allows to do this.  Also fixes bug#57728.

* src/term.c (tty_write_glyphs, tty_write_glyphs_with_face): Write on
the bottom-right character cell if the terminal supports it.

* src/term.c (glyph_on_char_cell_before_last): New static variable to
hold the current glyph on the character cell before the cell on the
bottom-right corner.
=2D--
 src/term.c | 266 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 225 insertions(+), 41 deletions(-)

diff --git a/src/term.c b/src/term.c
index 2e43d892..283a65c4 100644
=2D-- a/src/term.c
+++ b/src/term.c
@@ -718,7 +718,7 @@ encode_terminal_code (struct glyph *src, int src_len,
   return (encode_terminal_dst);
 }
=20
=2D
+static struct glyph glyph_on_char_cell_before_last;
=20
 /* An implementation of write_glyphs for termcap frames. */
=20
@@ -727,7 +727,7 @@ tty_write_glyphs (struct frame *f, struct glyph *string=
, int len)
 {
   unsigned char *conversion_buffer;
   struct coding_system *coding;
=2D  int n, stringlen;
+  int n, stringlen, write_on_last_cell;
=20
   struct tty_display_info *tty =3D FRAME_TTY (f);
=20
@@ -737,55 +737,158 @@ tty_write_glyphs (struct frame *f, struct glyph *str=
ing, int len)
   /* Don't dare write in last column of bottom line, if Auto-Wrap,
      since that would scroll the whole frame on some terminals.  */
=20
=2D  if (AutoWrap (tty)
=2D      && curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
=2D      && (curX (tty) + len) =3D=3D FRAME_COLS (f))
+  write_on_last_cell =3D (AutoWrap (tty)
+			&& curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
+			&& (curX (tty) + len) =3D=3D FRAME_COLS (f));
+  if (write_on_last_cell)
     len --;
=2D  if (len <=3D 0)
=2D    return;
=20
=2D  cmplus (tty, len);
+  if (FRAME_COLS (f) =3D=3D 1
+      || !(tty->TS_ins_char || tty->TS_ins_multi_chars
+	   || (tty->TS_insert_mode && tty->TS_end_insert_mode)))
+    write_on_last_cell =3D false;
+
+  if (len <=3D 0 && !write_on_last_cell)
+    return;
=20
   /* If terminal_coding does any conversion, use it, otherwise use
      safe_terminal_coding.  We can't use CODING_REQUIRE_ENCODING here
      because it always return 1 if the member src_multibyte is 1.  */
=2D  coding =3D (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_E=
NCODING_MASK
+  coding =3D ((FRAME_TERMINAL_CODING (f)->common_flags
+	     & CODING_REQUIRE_ENCODING_MASK)
 	    ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
   /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
      the tail.  */
   coding->mode &=3D ~CODING_MODE_LAST_BLOCK;
=20
=2D  for (stringlen =3D len; stringlen !=3D 0; stringlen -=3D n)
+  if (len > 0)
     {
=2D      /* Identify a run of glyphs with the same face.  */
=2D      int face_id =3D string->face_id;
+      cmplus (tty, len);
+
+      if (write_on_last_cell)
+	glyph_on_char_cell_before_last =3D string[len - 1];
+
+      for (stringlen =3D len; stringlen !=3D 0; stringlen -=3D n)
+	{
+	  /* Identify a run of glyphs with the same face.  */
+	  int face_id =3D string->face_id;
+
+	  for (n =3D 1; n < stringlen; ++n)
+	    if (string[n].face_id !=3D face_id)
+	      break;
+
+	  /* Turn appearance modes of the face of the run on.  */
+	  tty_highlight_if_desired (tty);
+	  turn_on_face (f, face_id);
=20
=2D      for (n =3D 1; n < stringlen; ++n)
=2D	if (string[n].face_id !=3D face_id)
=2D	  break;
+	  if (n =3D=3D stringlen && !write_on_last_cell)
+	    /* This is the last run.  */
+	    coding->mode |=3D CODING_MODE_LAST_BLOCK;
+	  conversion_buffer =3D encode_terminal_code (string, n,
+						    coding);
+	  if (coding->produced > 0)
+	    {
+	      block_input ();
+	      fwrite (conversion_buffer, 1, coding->produced,
+		      tty->output);
+	      clearerr (tty->output);
+	      if (tty->termscript)
+		fwrite (conversion_buffer, 1, coding->produced,
+			tty->termscript);
+	      unblock_input ();
+	    }
+	  string +=3D n;
=20
=2D      /* Turn appearance modes of the face of the run on.  */
+	  /* Turn appearance modes off.  */
+	  turn_off_face (f, face_id);
+	  tty_turn_off_highlight (tty);
+	}
+    }
+
+  /* Write on the bottom-right corner. */
+  if (write_on_last_cell)
+    {
+      /* Go to the previous position. */
+      cmgoto (tty, curY (tty), curX (tty) - 1);
+      cmplus (tty, 1);
+
+      int face_id =3D string->face_id;
+
+      /* Turn appearance modes of the face.  */
       tty_highlight_if_desired (tty);
       turn_on_face (f, face_id);
=20
=2D      if (n =3D=3D stringlen)
=2D	/* This is the last run.  */
=2D	coding->mode |=3D CODING_MODE_LAST_BLOCK;
=2D      conversion_buffer =3D encode_terminal_code (string, n, coding);
+      conversion_buffer =3D encode_terminal_code (string, 1, coding);
       if (coding->produced > 0)
 	{
 	  block_input ();
=2D	  fwrite (conversion_buffer, 1, coding->produced, tty->output);
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
 	  clearerr (tty->output);
 	  if (tty->termscript)
=2D	    fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
+	  unblock_input ();
+	}
+
+      /* Go to the previous position. */
+      cmgoto (tty, curY (tty), curX (tty) - 1);
+      cmplus (tty, 1);
+
+      /* Arrange that after writing the next glyph, the glyph on the
+         current character cell is somehow pushed to the bottom-right
+	 corner. */
+      if (tty->TS_ins_char)
+	{
+	  OUTPUT1 (tty, tty->TS_ins_char);
+	}
+      else if (tty->TS_ins_multi_chars)
+	{
+	  char *buf =3D tparam (tty->TS_ins_multi_chars, 0, 0, 1, 0,
+			      0, 0);
+	  OUTPUT1 (tty, buf);
+	  xfree (buf);
+	}
+      else
+	{
+	  tty_turn_on_insert (tty);
+	}
+
+      if (face_id !=3D glyph_on_char_cell_before_last.face_id)
+	{
+
+	  /* Turn appearance modes of the face.  */
+	  turn_off_face (f, face_id);
+	  tty_turn_off_highlight (tty);
+
+	  face_id =3D glyph_on_char_cell_before_last.face_id;
+
+	  tty_highlight_if_desired (tty);
+	  turn_on_face (f, face_id);
+	}
+
+      /* This is the last run.  */
+      coding->mode |=3D CODING_MODE_LAST_BLOCK;
+      conversion_buffer
+	=3D encode_terminal_code (&glyph_on_char_cell_before_last, 1,
+				coding);
+      if (coding->produced > 0)
+	{
+	  block_input ();
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
+	  clearerr (tty->output);
+	  if (tty->termscript)
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
 	  unblock_input ();
 	}
=2D      string +=3D n;
=20
       /* Turn appearance modes off.  */
       turn_off_face (f, face_id);
       tty_turn_off_highlight (tty);
+
+      tty_turn_off_insert (tty);
     }
=20
   cmcheckmagic (tty);
@@ -799,6 +902,7 @@ tty_write_glyphs_with_face (register struct frame *f, r=
egister struct glyph *str
 {
   unsigned char *conversion_buffer;
   struct coding_system *coding;
+  int write_on_last_cell;
=20
   struct tty_display_info *tty =3D FRAME_TTY (f);
=20
@@ -808,38 +912,118 @@ tty_write_glyphs_with_face (register struct frame *f=
, register struct glyph *str
   /* Don't dare write in last column of bottom line, if Auto-Wrap,
      since that would scroll the whole frame on some terminals.  */
=20
=2D  if (AutoWrap (tty)
=2D      && curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
=2D      && (curX (tty) + len) =3D=3D FRAME_COLS (f))
+  write_on_last_cell =3D (AutoWrap (tty)
+			&& curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
+			&& (curX (tty) + len) =3D=3D FRAME_COLS (f));
+  if (write_on_last_cell)
     len --;
=2D  if (len <=3D 0)
=2D    return;
=20
=2D  cmplus (tty, len);
+  if (FRAME_COLS (f) =3D=3D 1
+      || !(tty->TS_ins_char || tty->TS_ins_multi_chars
+	   || (tty->TS_insert_mode && tty->TS_end_insert_mode)))
+    write_on_last_cell =3D false;
+
+  if (len <=3D 0 && !write_on_last_cell)
+    return;
=20
   /* If terminal_coding does any conversion, use it, otherwise use
      safe_terminal_coding.  We can't use CODING_REQUIRE_ENCODING here
      because it always return 1 if the member src_multibyte is 1.  */
=2D  coding =3D (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_E=
NCODING_MASK
+  coding =3D ((FRAME_TERMINAL_CODING (f)->common_flags
+	     & CODING_REQUIRE_ENCODING_MASK)
 	    ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
=2D  /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
=2D     the tail.  */
+
+  /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only
+     at the tail.  */
   coding->mode &=3D ~CODING_MODE_LAST_BLOCK;
=20
   /* Turn appearance modes of the face.  */
   tty_highlight_if_desired (tty);
   turn_on_face (f, face_id);
=20
=2D  coding->mode |=3D CODING_MODE_LAST_BLOCK;
=2D  conversion_buffer =3D encode_terminal_code (string, len, coding);
=2D  if (coding->produced > 0)
+  if (len > 0)
+    {
+      cmplus (tty, len);
+      if (write_on_last_cell)
+	glyph_on_char_cell_before_last =3D string[len - 1];
+      else
+	coding->mode |=3D CODING_MODE_LAST_BLOCK;
+
+      conversion_buffer =3D encode_terminal_code (string, len, coding);
+      if (coding->produced > 0)
+	{
+	  block_input ();
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
+	  clearerr (tty->output);
+	  if (tty->termscript)
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
+	  unblock_input ();
+	}
+    }
+
+  /* Write on the bottom-right corner. */
+  if (write_on_last_cell)
     {
=2D      block_input ();
=2D      fwrite (conversion_buffer, 1, coding->produced, tty->output);
=2D      clearerr (tty->output);
=2D      if (tty->termscript)
=2D	fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
=2D      unblock_input ();
+      /* Go to the previous position. */
+      cmgoto (tty, curY (tty), curX (tty) - 1);
+      cmplus (tty, 1);
+
+      conversion_buffer =3D encode_terminal_code (string, 1, coding);
+      if (coding->produced > 0)
+	{
+	  block_input ();
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
+	  clearerr (tty->output);
+	  if (tty->termscript)
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
+	  unblock_input ();
+	}
+
+      /* Go to the previous position. */
+      cmgoto (tty, curY (tty), curX (tty) - 1);
+      cmplus (tty, 1);
+
+      /* Arrange that after writing the next glyph, the glyph on the
+         current character cell is somehow pushed to the bottom-right
+	 corner. */
+      if (tty->TS_ins_char)
+	{
+	  OUTPUT1 (tty, tty->TS_ins_char);
+	}
+      else if (tty->TS_ins_multi_chars)
+	{
+	  char *buf =3D tparam (tty->TS_ins_multi_chars, 0, 0, 1,
+			      0, 0, 0);
+	  OUTPUT1 (tty, buf);
+	  xfree (buf);
+	}
+      else
+	{
+	  tty_turn_on_insert (tty);
+	}
+
+      /* This is the last run.  */
+      coding->mode |=3D CODING_MODE_LAST_BLOCK;
+      conversion_buffer
+	=3D encode_terminal_code (&glyph_on_char_cell_before_last, 1,
+				coding);
+      if (coding->produced > 0)
+	{
+	  block_input ();
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
+	  clearerr (tty->output);
+	  if (tty->termscript)
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
+	  unblock_input ();
+	}
+
+      tty_turn_off_insert (tty);
     }
=20
   /* Turn appearance modes off.  */
=2D-=20
2.37.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0002-Merge-tty_write_glyphs-and-tty_write_glyphs_with_fac.patch
Content-Transfer-Encoding: quoted-printable
Content-Description: PATCH 2/2

From=20b090cba28981d7a0e40f87211e9b8b065bfdf3e3 Mon Sep 17 00:00:00 2001
From: Akib Azmain Turja <akib@HIDDEN>
Date: Tue, 4 Oct 2022 18:54:58 +0600
Subject: [PATCH 2/2] Merge tty_write_glyphs and tty_write_glyphs_with_face

* src/term.c (tty_write_glyphs_1, tty_write_glyphs)
(tty_write_glyphs_with_face): Merge tty_write_glyphs and
tty_write_glyphs_with_face into tty_write_glyphs_1.  Define
tty_write_glyphs as a wrapper of tty_write_glyphs_1.
=2D--
 src/term.c | 243 +++++++++++++++++------------------------------------
 1 file changed, 79 insertions(+), 164 deletions(-)

diff --git a/src/term.c b/src/term.c
index 283a65c4..db1dd2a4 100644
=2D-- a/src/term.c
+++ b/src/term.c
@@ -723,7 +723,8 @@ encode_terminal_code (struct glyph *src, int src_len,
 /* An implementation of write_glyphs for termcap frames. */
=20
 static void
=2Dtty_write_glyphs (struct frame *f, struct glyph *string, int len)
+tty_write_glyphs_1 (struct frame *f, struct glyph *string, int len,
+		    int face_id)
 {
   unsigned char *conversion_buffer;
   struct coding_system *coding;
@@ -761,6 +762,13 @@ tty_write_glyphs (struct frame *f, struct glyph *strin=
g, int len)
      the tail.  */
   coding->mode &=3D ~CODING_MODE_LAST_BLOCK;
=20
+  if (face_id >=3D 0)
+    {
+      /* Turn appearance modes of the face.  */
+      tty_highlight_if_desired (tty);
+      turn_on_face (f, face_id);
+    }
+
   if (len > 0)
     {
       cmplus (tty, len);
@@ -770,16 +778,27 @@ tty_write_glyphs (struct frame *f, struct glyph *stri=
ng, int len)
=20
       for (stringlen =3D len; stringlen !=3D 0; stringlen -=3D n)
 	{
=2D	  /* Identify a run of glyphs with the same face.  */
=2D	  int face_id =3D string->face_id;
+	  int local_face_id;
=20
=2D	  for (n =3D 1; n < stringlen; ++n)
=2D	    if (string[n].face_id !=3D face_id)
=2D	      break;
+	  if (face_id >=3D 0)
+	    {
+	      /* This will be a problem when we run the loop another
+	         time, but this is the only iteration. */
+	      n =3D stringlen;
+	    }
+	  else
+	    {
+	      /* Identify a run of glyphs with the same face.  */
+	      local_face_id =3D string->face_id;
=20
=2D	  /* Turn appearance modes of the face of the run on.  */
=2D	  tty_highlight_if_desired (tty);
=2D	  turn_on_face (f, face_id);
+	      for (n =3D 1; n < stringlen; ++n)
+		if (string[n].face_id !=3D local_face_id)
+		  break;
+
+	      /* Turn appearance modes of the face of the run on.  */
+	      tty_highlight_if_desired (tty);
+	      turn_on_face (f, local_face_id);
+	    }
=20
 	  if (n =3D=3D stringlen && !write_on_last_cell)
 	    /* This is the last run.  */
@@ -799,24 +818,41 @@ tty_write_glyphs (struct frame *f, struct glyph *stri=
ng, int len)
 	    }
 	  string +=3D n;
=20
=2D	  /* Turn appearance modes off.  */
=2D	  turn_off_face (f, face_id);
=2D	  tty_turn_off_highlight (tty);
+	  if (face_id < 0)
+	    {
+	      /* Turn appearance modes off.  */
+	      turn_off_face (f, local_face_id);
+	      tty_turn_off_highlight (tty);
+	    }
 	}
     }
=20
   /* Write on the bottom-right corner. */
   if (write_on_last_cell)
     {
=2D      /* Go to the previous position. */
+      /* The algorithm here is: we write the whole string except the
+         last glyph, then move back to the beginning of previous
+	 glyph, write the last glyph, move back again, and insert the
+	 glyph before the last glyph in such a way that last glyph at
+         cursor' position gets pushed to the corner. */
+
+      /* Go to the beginning of previous glyph. */
+      /* BUG: This assume the previous glyph is a single column width
+         glyph, so this won't work for multi column width, and the
+         result is terminal-dependent. */
       cmgoto (tty, curY (tty), curX (tty) - 1);
       cmplus (tty, 1);
=20
=2D      int face_id =3D string->face_id;
+      int local_face_id;
=20
=2D      /* Turn appearance modes of the face.  */
=2D      tty_highlight_if_desired (tty);
=2D      turn_on_face (f, face_id);
+      if (face_id < 0)
+	{
+	  local_face_id =3D string->face_id;
+
+	  /* Turn appearance modes of the face.  */
+	  tty_highlight_if_desired (tty);
+	  turn_on_face (f, local_face_id);
+	}
=20
       conversion_buffer =3D encode_terminal_code (string, 1, coding);
       if (coding->produced > 0)
@@ -831,12 +867,15 @@ tty_write_glyphs (struct frame *f, struct glyph *stri=
ng, int len)
 	  unblock_input ();
 	}
=20
=2D      /* Go to the previous position. */
+      /* Go to the beginning of previous glyph. */
+      /* BUG: This assume the previous glyph is a single column width
+         glyph, so this won't work for multi column width, and the
+         result is terminal-dependent. */
       cmgoto (tty, curY (tty), curX (tty) - 1);
       cmplus (tty, 1);
=20
       /* Arrange that after writing the next glyph, the glyph on the
=2D         current character cell is somehow pushed to the bottom-right
+         current character cell gets pushed to the bottom-right
 	 corner. */
       if (tty->TS_ins_char)
 	{
@@ -854,17 +893,18 @@ tty_write_glyphs (struct frame *f, struct glyph *stri=
ng, int len)
 	  tty_turn_on_insert (tty);
 	}
=20
=2D      if (face_id !=3D glyph_on_char_cell_before_last.face_id)
+      if (face_id < 0
+	  && local_face_id !=3D glyph_on_char_cell_before_last.face_id)
 	{
=20
 	  /* Turn appearance modes of the face.  */
=2D	  turn_off_face (f, face_id);
+	  turn_off_face (f, local_face_id);
 	  tty_turn_off_highlight (tty);
=20
=2D	  face_id =3D glyph_on_char_cell_before_last.face_id;
+	  local_face_id =3D glyph_on_char_cell_before_last.face_id;
=20
 	  tty_highlight_if_desired (tty);
=2D	  turn_on_face (f, face_id);
+	  turn_on_face (f, local_face_id);
 	}
=20
       /* This is the last run.  */
@@ -884,157 +924,32 @@ tty_write_glyphs (struct frame *f, struct glyph *str=
ing, int len)
 	  unblock_input ();
 	}
=20
+      if (face_id < 0)
+	{
+	  /* Turn appearance modes off.  */
+	  turn_off_face (f, local_face_id);
+	  tty_turn_off_highlight (tty);
+	}
+
+      tty_turn_off_insert (tty);
+    }
+
+  if (face_id >=3D 0)
+    {
       /* Turn appearance modes off.  */
       turn_off_face (f, face_id);
       tty_turn_off_highlight (tty);
=2D
=2D      tty_turn_off_insert (tty);
     }
=20
   cmcheckmagic (tty);
 }
=20
=2D#ifndef DOS_NT
=2D
 static void
=2Dtty_write_glyphs_with_face (register struct frame *f, register struct gl=
yph *string,
=2D			    register int len, register int face_id)
+tty_write_glyphs (struct frame *f, struct glyph *string, int len)
 {
=2D  unsigned char *conversion_buffer;
=2D  struct coding_system *coding;
=2D  int write_on_last_cell;
=2D
=2D  struct tty_display_info *tty =3D FRAME_TTY (f);
=2D
=2D  tty_turn_off_insert (tty);
=2D  tty_hide_cursor (tty);
=2D
=2D  /* Don't dare write in last column of bottom line, if Auto-Wrap,
=2D     since that would scroll the whole frame on some terminals.  */
=2D
=2D  write_on_last_cell =3D (AutoWrap (tty)
=2D			&& curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
=2D			&& (curX (tty) + len) =3D=3D FRAME_COLS (f));
=2D  if (write_on_last_cell)
=2D    len --;
=2D
=2D  if (FRAME_COLS (f) =3D=3D 1
=2D      || !(tty->TS_ins_char || tty->TS_ins_multi_chars
=2D	   || (tty->TS_insert_mode && tty->TS_end_insert_mode)))
=2D    write_on_last_cell =3D false;
=2D
=2D  if (len <=3D 0 && !write_on_last_cell)
=2D    return;
=2D
=2D  /* If terminal_coding does any conversion, use it, otherwise use
=2D     safe_terminal_coding.  We can't use CODING_REQUIRE_ENCODING here
=2D     because it always return 1 if the member src_multibyte is 1.  */
=2D  coding =3D ((FRAME_TERMINAL_CODING (f)->common_flags
=2D	     & CODING_REQUIRE_ENCODING_MASK)
=2D	    ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
=2D
=2D  /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only
=2D     at the tail.  */
=2D  coding->mode &=3D ~CODING_MODE_LAST_BLOCK;
=2D
=2D  /* Turn appearance modes of the face.  */
=2D  tty_highlight_if_desired (tty);
=2D  turn_on_face (f, face_id);
=2D
=2D  if (len > 0)
=2D    {
=2D      cmplus (tty, len);
=2D      if (write_on_last_cell)
=2D	glyph_on_char_cell_before_last =3D string[len - 1];
=2D      else
=2D	coding->mode |=3D CODING_MODE_LAST_BLOCK;
=2D
=2D      conversion_buffer =3D encode_terminal_code (string, len, coding);
=2D      if (coding->produced > 0)
=2D	{
=2D	  block_input ();
=2D	  fwrite (conversion_buffer, 1, coding->produced,
=2D		  tty->output);
=2D	  clearerr (tty->output);
=2D	  if (tty->termscript)
=2D	    fwrite (conversion_buffer, 1, coding->produced,
=2D		    tty->termscript);
=2D	  unblock_input ();
=2D	}
=2D    }
=2D
=2D  /* Write on the bottom-right corner. */
=2D  if (write_on_last_cell)
=2D    {
=2D      /* Go to the previous position. */
=2D      cmgoto (tty, curY (tty), curX (tty) - 1);
=2D      cmplus (tty, 1);
=2D
=2D      conversion_buffer =3D encode_terminal_code (string, 1, coding);
=2D      if (coding->produced > 0)
=2D	{
=2D	  block_input ();
=2D	  fwrite (conversion_buffer, 1, coding->produced,
=2D		  tty->output);
=2D	  clearerr (tty->output);
=2D	  if (tty->termscript)
=2D	    fwrite (conversion_buffer, 1, coding->produced,
=2D		    tty->termscript);
=2D	  unblock_input ();
=2D	}
=2D
=2D      /* Go to the previous position. */
=2D      cmgoto (tty, curY (tty), curX (tty) - 1);
=2D      cmplus (tty, 1);
=2D
=2D      /* Arrange that after writing the next glyph, the glyph on the
=2D         current character cell is somehow pushed to the bottom-right
=2D	 corner. */
=2D      if (tty->TS_ins_char)
=2D	{
=2D	  OUTPUT1 (tty, tty->TS_ins_char);
=2D	}
=2D      else if (tty->TS_ins_multi_chars)
=2D	{
=2D	  char *buf =3D tparam (tty->TS_ins_multi_chars, 0, 0, 1,
=2D			      0, 0, 0);
=2D	  OUTPUT1 (tty, buf);
=2D	  xfree (buf);
=2D	}
=2D      else
=2D	{
=2D	  tty_turn_on_insert (tty);
=2D	}
=2D
=2D      /* This is the last run.  */
=2D      coding->mode |=3D CODING_MODE_LAST_BLOCK;
=2D      conversion_buffer
=2D	=3D encode_terminal_code (&glyph_on_char_cell_before_last, 1,
=2D				coding);
=2D      if (coding->produced > 0)
=2D	{
=2D	  block_input ();
=2D	  fwrite (conversion_buffer, 1, coding->produced,
=2D		  tty->output);
=2D	  clearerr (tty->output);
=2D	  if (tty->termscript)
=2D	    fwrite (conversion_buffer, 1, coding->produced,
=2D		    tty->termscript);
=2D	  unblock_input ();
=2D	}
=2D
=2D      tty_turn_off_insert (tty);
=2D    }
=2D
=2D  /* Turn appearance modes off.  */
=2D  turn_off_face (f, face_id);
=2D  tty_turn_off_highlight (tty);
=2D
=2D  cmcheckmagic (tty);
+  tty_write_glyphs_1 (f, string, len, -1);
 }
=20
=2D#endif
=2D
 /* An implementation of insert_glyphs for termcap frames. */
=20
 static void
@@ -2615,8 +2530,8 @@ tty_draw_row_with_mouse_face (struct window *w, struc=
t glyph_row *row,
   cursor_to (f, pos_y, pos_x);
=20
   if (draw =3D=3D DRAW_MOUSE_FACE)
=2D    tty_write_glyphs_with_face (f, row->glyphs[TEXT_AREA] + start_hpos,
=2D				nglyphs, face_id);
+    tty_write_glyphs_1 (f, row->glyphs[TEXT_AREA] + start_hpos,
+			nglyphs, face_id);
   else if (draw =3D=3D DRAW_NORMAL_TEXT)
     write_glyphs (f, row->glyphs[TEXT_AREA] + start_hpos, nglyphs);
=20
=2D-=20
2.37.1


--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable


=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=--

--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmM8L5EACgkQVTX89U2I
YWspHg/9GP+951K+Ly2rpsPxpgHyH7bPfA6ZQ0b6Bb+nrlwR6c/8akN4/f8IdUbk
F6ChnQ6FMbGHkY2RQA2sFPKo1wTv+GESgV6f7oN1K0tmsZLckGD8iLSFHEHkV2NT
8j93gsxroe8sMKE2q8sGM3YCGl64ZP2+kUpYQXx1rrZ+VW+2SdCDY1tY/El8GptM
LVBtj6PlBYrQ/m+Ysp/VOWlMrsKhye811b+N8Q7PfJHam4c+KFqH8Pd8aRrvhXoI
gzyO3A2lq6QINa7Bq5KjbMsRXUQP6S/yZJP6vL8kqzG+eIPt+euBo3E+RgQ/K00Y
9TICQ3QVAGGQwD30ZyZd+/h/SaJvKBylfNy99zpZ3riiX0Rj3ETD65Lfo/qy3ryF
n17XI5PAEPzlpQxQ6gQu9lNLC/f7XgWvPFg3ODkwj3U6wveVsyuzouuQjpqHue8a
QTHOx6shn/3H6TLWC2PYjwm0FhHnCoCxJqCJ1n12wDMj8fTzLEk4L4SwSRPlsShC
H0fqc/epkrXOZqvg+ebE1tl4C9ZI3pDeCBacsB6Ixp89XkuljsxkZrU7lQN0gOrf
YqgsyLZsG4RXHfZvERdEUMV2HsVqSZhVMQ4IJyMOaqfG1Qln/c050IOTBHjvpIXk
qN6i+4jKBaVP3qwoPQ1WOAbcTspbDVjwI7fPzVDHBzqWSx5JiX4=
=oAel
-----END PGP SIGNATURE-----
--==-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 4 Oct 2022 12:55:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 04 08:55:31 2022
Received: from localhost ([127.0.0.1]:52883 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ofhSN-0003Xo-3s
	for submit <at> debbugs.gnu.org; Tue, 04 Oct 2022 08:55:31 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40874)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ofhSK-0003Xa-Ma
 for 57607 <at> debbugs.gnu.org; Tue, 04 Oct 2022 08:55:29 -0400
Received: from fencepost.gnu.org ([209.51.188.10]:52748)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ofhSD-0002hm-BN; Tue, 04 Oct 2022 08:55:22 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=y7ZhKZ3unenz3lRaoR6qAr7WIOrl+lVlD9BwAQrbx9Y=; b=hH6YzYh7XASl
 /WhwiPv+QGKAw6yh+QLfXvs3Y/PkzAXd7gjqHvXdzhTdlWIjAGJA+wTbP0C/QIKIWdWFig5peREzk
 sSLhwRH3AUEsQFR2a+JnBg+G8e0p1OqwTZ2W9aZMumhikKhqLtVy3Wq5dW8JidodkTdELNAQz3wIZ
 GeqMUAdrPTxtYZSV1fwCqQ8qBGAWFafIK8qNNG0UNT2iZthDJpN9q9jq40AisyjuUnAPKaAJlq5BM
 Ohaw+aBV9copzePEHOFWXOr85KhiUH322bJcKgrqPn3H4fHrSc7vBiYt8TVNoACVRxOJBn+eLypCv
 v8wgh0VnsMOqSWhwPCjKfQ==;
Received: from [87.69.77.57] (port=1725 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ofhS5-0007yi-Lx; Tue, 04 Oct 2022 08:55:20 -0400
Date: Tue, 04 Oct 2022 15:54:48 +0300
Message-Id: <83o7urvjdz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Akib Azmain Turja <akib@HIDDEN>
In-Reply-To: <87lepver2e.fsf@HIDDEN> (message from Akib Azmain Turja on
 Tue, 04 Oct 2022 18:00:57 +0600)
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <87r0zpi9za.fsf@HIDDEN> <83y1twwv7w.fsf@HIDDEN>
 <87edvohx2s.fsf@HIDDEN> <83a66cvwob.fsf@HIDDEN>
 <87lepver2e.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57607
Cc: gerd.moellmann@HIDDEN, 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Akib Azmain Turja <akib@HIDDEN>
> Cc: 57607 <at> debbugs.gnu.org,  gerd.moellmann@HIDDEN
> Date: Tue, 04 Oct 2022 18:00:57 +0600
> 
> > Please try with some 2-column CJK characters, I'm not sure the example
> > with ^L is relevant here.  You can find the list of wide characters in
> > characters.el (search for "width"); for example, characters in the
> > U+FF00 block can be useful.
> 
> Thanks, "CJK STROKE D" doesn't work as expected, and the result depends
> on terminal in use.  How can I determine the width of a glyph?

Like this:

  (char-width CHAR)

where CHAR is the character you are interested in.  For example:

  (char-width #x31D4)
   => 2

From C, you can call char_width, like Fchar_width (which see) does.

One other subtle point: the argument STRING to tty_write_glyphs is a
string of 'struct glyph' objects, not a string of characters.  Each
struct glyph has the code of the character to display in its u.ch
member, if the glyph is a simple character glyph; for the full story
see encode_terminal_code.

> > (And the existing code could have bugs,
> > no need to assume it is always correct.)
> 
> Yes, it can, but in most cases, my brain has more bugs.

Indeed, that the existing code has bugs should not be our first
hypothesis.  But it shouldn't be axiomatic that there are no bugs
there ;-)

> > face_id is an integer, and zero is a valid value (it means the default
> > face), so NULL won't do.  But you can use -1 to mean "no face ID".
> > Just make sure you never pass it to FACE_FROM_ID etc.
> >
> > Thanks.
> 
> OK, I'll try that.  Thanks.

TIA




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 4 Oct 2022 12:04:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 04 08:04:04 2022
Received: from localhost ([127.0.0.1]:52785 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ofgea-0006Fo-8w
	for submit <at> debbugs.gnu.org; Tue, 04 Oct 2022 08:04:04 -0400
Received: from knopi.disroot.org ([178.21.23.139]:53118)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1ofgeX-0006FN-Md
 for 57607 <at> debbugs.gnu.org; Tue, 04 Oct 2022 08:04:03 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 611D34C795;
 Tue,  4 Oct 2022 14:04:00 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with UTF8SMTP id 3bP6PsgANieI; Tue,  4 Oct 2022 14:03:59 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1664884971; bh=FwOhoRQYG1Rb/1Y/+ql0YKgGAelDd7i48++PU2Fjy1s=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=YaoikeMM7NJCqZtkHNn76q9AUip7zpgFEHyVv9WKD2kLJI2gRCIvboehe6CLE5ZEX
 nniyZqqq6p49CgPMv8UddgHQLIE0OESQLe8+91aKFIa9vZvzlXWdIBbMK2VOZfKncP
 wubZYxvNF+W99qXWCr4EbEDWYdMGIaEDt7z8qL61Nil+viLAMjnGUhHiu/cid+SUkQ
 fElQbFanqcY07tF7aAbsJW/rAtMFrHMkgLE58brnwLzW+x0C3peYbkKKsGXVroYqqf
 Cpt7W6GzHK5x5J44kQhR2CVYlWICIKD3HB4ahK6AhqSQBr+8xqnRMIJdFMLVTM1PKx
 5j0XUxkRhkBkg==
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <83a66cvwob.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 04 Oct
 2022 11:07:48 +0300")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <87r0zpi9za.fsf@HIDDEN> <83y1twwv7w.fsf@HIDDEN>
 <87edvohx2s.fsf@HIDDEN> <83a66cvwob.fsf@HIDDEN>
Date: Tue, 04 Oct 2022 18:00:57 +0600
Message-ID: <87lepver2e.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: gerd.moellmann@HIDDEN, 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Akib Azmain Turja <akib@HIDDEN>
>> Cc: 57607 <at> debbugs.gnu.org,  gerd.moellmann@HIDDEN
>> Date: Tue, 04 Oct 2022 13:22:51 +0600
>>=20
>> > Thanks.  But could you please describe the idea of the patch in some
>> > comment?  It is hard to follow the code, especially since the diff has
>> > many pure whitespace changes.
>>=20
>> The idea is that you write the string just like before (for example, you
>> want to write "hello" in a five columns width terminal, so you write
>> only "hell", so that the line shows "hell "), then move a character
>> backward and write the last glyph (write "o", so that the line shows
>> "helo "), move a character backward again and arrange that after writing
>> the next glyph, the character on the current position will be pushed
>> towards right and write the glyph before the last one (write "l", now
>> the line shows "hello").
>>=20
>> Should I add the explanation to the function as comment?
>
> Yes, please.  It would also help if the respective parts of the code
> were annotated with comments that explain their role in the algorithm.

OK.

>
>> > Also, this:
>> >
>> >> +      /* Go to the previous position. */
>> >> +      cmgoto (tty, curY (tty), curX (tty) - 1);
>> >> +      cmplus (tty, 1);
>> >
>> > Seem to assume the last character takes just one column?  What about
>> > characters whose width is 2 columns?
>>=20
>> Yes, I assume that.  I don't think any multi-char width glyph reach this
>> function (I think they are converted to single column width glyphs, for
>> example "^L" is converted to "^" and "L").  The reason of the assumption
>> is the following code:
>>=20
>> --8<---------------cut here---------------start------------->8---
>>   if (AutoWrap (tty)
>>       && curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
>>       && (curX (tty) + len) =3D=3D FRAME_COLS (f))
>>     len --;
>> --8<---------------cut here---------------end--------------->8---
>>=20
>> Which also assumes the same.
>
> Please try with some 2-column CJK characters, I'm not sure the example
> with ^L is relevant here.  You can find the list of wide characters in
> characters.el (search for "width"); for example, characters in the
> U+FF00 block can be useful.

Thanks, "CJK STROKE D" doesn't work as expected, and the result depends
on terminal in use.  How can I determine the width of a glyph?

> (And the existing code could have bugs,
> no need to assume it is always correct.)

Yes, it can, but in most cases, my brain has more bugs.

>
>> > And finally, it would be nice to avoid so much code duplication
>> > between tty_write_glyphs and tty_write_glyphs_with_face.  Is that
>> > feasible?
>>=20
>> Yes, I think so.  I think it possible to just add a new argument
>> "face_id" to tty_write_glyphs would the trick.  tty_write_glyph will try
>> to use "face_id" if it is specified, otherwise fallback to the face_id
>> in the string.  But how to "not" specify a face_id?  Would a NULL work?
>
> face_id is an integer, and zero is a valid value (it means the default
> face), so NULL won't do.  But you can use -1 to mean "no face ID".
> Just make sure you never pass it to FACE_FROM_ID etc.
>
> Thanks.

OK, I'll try that.  Thanks.

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmM8IHkACgkQVTX89U2I
YWv2DQ//QW4mpgZE35s0WuBv4h0n4laiCnG2MK0OY6Hg1LKXBPzadjtK6yKVd9nh
Qc8e7xaTDxhY3ggCnc1dURBkU1OhaSGT1Y5Nu4kUgEOo3nqrbR0VOhbUFD+sh8Om
bz+127SyhHepZCbqS54+SWyGIcUlg8dFN9ow5vc3tHLZ2SDQTbR8FYXPoDzDvn48
q/gHsqzsrN9SHS9FugE2GXP7HJzhhui832ZY8swcFIY+J3OIZL58cQ2V8P29qV9T
u9g+s0SSkkxbZwF3qBFbKgOcG1bd6P07IYTpWZkSfI+gdXvvSSm68i8uLaEUTvY2
7M5YO67m/rJwAtbQkGo+z4Dp43tjrEvGqx+42Ak3T8ccoE364v3fM4gLLVV93Tor
MZZVLbOXBE0+fPyxy7+2lznYfcVHuk2aCqcvfOHtzk3rKs2j7StgwoD1TuX70ZmE
kgS7GkKm74kTU7G4DZutlFWe1E+fC6RZBjwHYm8MTkXymZtQs4cKBX0pj7Dqw+1Z
aUeiaz03lbTIRriH/AUSvjfl8f/bJiPBLYtP1VfvCXTlEHT4Ud09o3pNUoTYAo1X
RsM+g2emgvBE+tauwypog4TuFAUHC3uKutmKwzyOCeKENkheEkq1laJ/PIrkB6Qo
JvbN1UV6L2D12yxcVmYl72QdCMzkmxXayjAsS0GIzA+V+nTr7aM=
=szh2
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 4 Oct 2022 08:08:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 04 04:08:00 2022
Received: from localhost ([127.0.0.1]:52369 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ofcy7-0005oq-V5
	for submit <at> debbugs.gnu.org; Tue, 04 Oct 2022 04:08:00 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45678)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ofcy6-0005od-QY
 for 57607 <at> debbugs.gnu.org; Tue, 04 Oct 2022 04:07:59 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40374)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ofcy1-000692-IA; Tue, 04 Oct 2022 04:07:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=Yij1z8lYqDxuHGvy6OAkoOoVDZ1TJaNt3Xz1Oj1zAW8=; b=pMnPsXvo3LsD
 jP8BOySQzIiykmuGRQaafcZOzRDj8gY4i8kFujfHy6ePIGG4ZKGiNjUY2CE09pc5ap6iXCdBThRV/
 5xbas3jgRzLWxENmJcDeFWR6wR5xJdEnumuQuvYOxwaL+929PG+Kfw7gl3kf7fDPEqNUNNfF6/Yul
 22xalRGF5LpZ4Oe5zhdHnLisuz5A4YRjPhdTokp+s+tjZDtP5E5xKf4qYHajav3YvnVFO1/fdON3a
 U1oefdk3TYrZjRrMXZfOJF++r3Jg+qevIy7fx15enOxxuri9etdBeqFtaxy3eKIjE6e1u7YcayRkG
 8xlVMvbyUIo2D+27dKxNRw==;
Received: from [87.69.77.57] (port=3719 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ofcy1-0004kD-1n; Tue, 04 Oct 2022 04:07:53 -0400
Date: Tue, 04 Oct 2022 11:07:48 +0300
Message-Id: <83a66cvwob.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Akib Azmain Turja <akib@HIDDEN>
In-Reply-To: <87edvohx2s.fsf@HIDDEN> (message from Akib Azmain Turja on
 Tue, 04 Oct 2022 13:22:51 +0600)
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <87r0zpi9za.fsf@HIDDEN> <83y1twwv7w.fsf@HIDDEN>
 <87edvohx2s.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57607
Cc: gerd.moellmann@HIDDEN, 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Akib Azmain Turja <akib@HIDDEN>
> Cc: 57607 <at> debbugs.gnu.org,  gerd.moellmann@HIDDEN
> Date: Tue, 04 Oct 2022 13:22:51 +0600
> 
> > Thanks.  But could you please describe the idea of the patch in some
> > comment?  It is hard to follow the code, especially since the diff has
> > many pure whitespace changes.
> 
> The idea is that you write the string just like before (for example, you
> want to write "hello" in a five columns width terminal, so you write
> only "hell", so that the line shows "hell "), then move a character
> backward and write the last glyph (write "o", so that the line shows
> "helo "), move a character backward again and arrange that after writing
> the next glyph, the character on the current position will be pushed
> towards right and write the glyph before the last one (write "l", now
> the line shows "hello").
> 
> Should I add the explanation to the function as comment?

Yes, please.  It would also help if the respective parts of the code
were annotated with comments that explain their role in the algorithm.

> > Also, this:
> >
> >> +      /* Go to the previous position. */
> >> +      cmgoto (tty, curY (tty), curX (tty) - 1);
> >> +      cmplus (tty, 1);
> >
> > Seem to assume the last character takes just one column?  What about
> > characters whose width is 2 columns?
> 
> Yes, I assume that.  I don't think any multi-char width glyph reach this
> function (I think they are converted to single column width glyphs, for
> example "^L" is converted to "^" and "L").  The reason of the assumption
> is the following code:
> 
> --8<---------------cut here---------------start------------->8---
>   if (AutoWrap (tty)
>       && curY (tty) + 1 == FRAME_TOTAL_LINES (f)
>       && (curX (tty) + len) == FRAME_COLS (f))
>     len --;
> --8<---------------cut here---------------end--------------->8---
> 
> Which also assumes the same.

Please try with some 2-column CJK characters, I'm not sure the example
with ^L is relevant here.  You can find the list of wide characters in
characters.el (search for "width"); for example, characters in the
U+FF00 block can be useful.  (And the existing code could have bugs,
no need to assume it is always correct.)

> > And finally, it would be nice to avoid so much code duplication
> > between tty_write_glyphs and tty_write_glyphs_with_face.  Is that
> > feasible?
> 
> Yes, I think so.  I think it possible to just add a new argument
> "face_id" to tty_write_glyphs would the trick.  tty_write_glyph will try
> to use "face_id" if it is specified, otherwise fallback to the face_id
> in the string.  But how to "not" specify a face_id?  Would a NULL work?

face_id is an integer, and zero is a valid value (it means the default
face), so NULL won't do.  But you can use -1 to mean "no face ID".
Just make sure you never pass it to FACE_FROM_ID etc.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 4 Oct 2022 07:26:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 04 03:26:27 2022
Received: from localhost ([127.0.0.1]:52280 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ofcJu-0004ii-If
	for submit <at> debbugs.gnu.org; Tue, 04 Oct 2022 03:26:26 -0400
Received: from knopi.disroot.org ([178.21.23.139]:58780)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1ofcJt-0004iZ-GB
 for 57607 <at> debbugs.gnu.org; Tue, 04 Oct 2022 03:26:25 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 618FF4C678;
 Tue,  4 Oct 2022 09:26:24 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 9Q3jvhpOFc63; Tue,  4 Oct 2022 09:26:23 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1664868382; bh=QK7aeURaODoRax05wun1sJXF4a0wwurizyhSDeOLfLU=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=fzBy/5FNSAKsOq6PnUJ5r08XUmjorzfxIfR21eDIjpv5D8QnnU3fIZpP2+w7Vj+ht
 uHIzgMmzSfoWhRfXexYK6v99vv/iDE6CIHkFJRwro0uRp+L3LPBVWiAu9uMJkbaZE1
 hSRK2I6tN5NE1isqmLu/ddMV/FASP8wdKLY6p+knpVCakGGfm74jZW7svKZW96or8X
 3ACXLJvBWfwcjqsZ/HRU9dNvahq8ruptg1K2+Q4NSIXdFggnBL0nqaBbK4IeC4EPFs
 +UzgPjHrII47x7aZwWHVj5qMkXmgQdwaZ5MjXWvBIgxhOPTl3A2O5tzlyv3/p36UHg
 cS/42LUEAvu+w==
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <83y1twwv7w.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 03 Oct
 2022 22:41:39 +0300")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <87r0zpi9za.fsf@HIDDEN> <83y1twwv7w.fsf@HIDDEN>
Date: Tue, 04 Oct 2022 13:22:51 +0600
Message-ID: <87edvohx2s.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: gerd.moellmann@HIDDEN, 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Eli Zaretskii <eliz@HIDDEN> writes:

>> Cc: gerd.moellmann@HIDDEN
>> Date: Mon, 03 Oct 2022 14:31:53 +0600
>> From:  Akib Azmain Turja via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
>>=20
>> I have implemented it.  Implementing it was easier than I thought.  Here
>> is the patch:
>
> Thanks.  But could you please describe the idea of the patch in some
> comment?  It is hard to follow the code, especially since the diff has
> many pure whitespace changes.

The idea is that you write the string just like before (for example, you
want to write "hello" in a five columns width terminal, so you write
only "hell", so that the line shows "hell "), then move a character
backward and write the last glyph (write "o", so that the line shows
"helo "), move a character backward again and arrange that after writing
the next glyph, the character on the current position will be pushed
towards right and write the glyph before the last one (write "l", now
the line shows "hello").

Should I add the explanation to the function as comment?

>
> Also, this:
>
>> +      /* Go to the previous position. */
>> +      cmgoto (tty, curY (tty), curX (tty) - 1);
>> +      cmplus (tty, 1);
>
> Seem to assume the last character takes just one column?  What about
> characters whose width is 2 columns?

Yes, I assume that.  I don't think any multi-char width glyph reach this
function (I think they are converted to single column width glyphs, for
example "^L" is converted to "^" and "L").  The reason of the assumption
is the following code:

=2D-8<---------------cut here---------------start------------->8---
  if (AutoWrap (tty)
      && curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
      && (curX (tty) + len) =3D=3D FRAME_COLS (f))
    len --;
=2D-8<---------------cut here---------------end--------------->8---

Which also assumes the same.

>
> And finally, it would be nice to avoid so much code duplication
> between tty_write_glyphs and tty_write_glyphs_with_face.  Is that
> feasible?

Yes, I think so.  I think it possible to just add a new argument
"face_id" to tty_write_glyphs would the trick.  tty_write_glyph will try
to use "face_id" if it is specified, otherwise fallback to the face_id
in the string.  But how to "not" specify a face_id?  Would a NULL work?

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmM730wACgkQVTX89U2I
YWsX8g/9EFBIU3hcDyRXv3G25Qdxrhev/kfyORzTg0SzpZzDkc3/zD18UL/7UkpH
sWorEYblrHq0gzVW2ELVu1wTatC38gEvt/dHZSAPkYuEbXrvVIfQzuColQPaIx05
Z8VTcJc65ojhnROMgrPtReHLZBpB259hagbldx4jNKeWb7Z1Rjn6XWXMVWkdEPxK
gyOrkhfjXLt4SxaQtsqV0VcAl/GzsSule4PiZQOePjTG4C6jdUggX3BgmOZryNAT
MpB9lja70bl36U4olPboj7jn3oui6btYQvMpA79Uiz0J9PslnAt/qe8CpudP+RVx
vHLY8aQt4KxMiXk8DmE4fFSCD1b+OamRQ2lzWfh3P6pmWV3ZUfW9YF/EDwss5SLQ
hAoJo4elpi++tWsyXtrqGOcWoT8arpXZL3hGJ/zuc6nVl3azaqAOq1t4eA85KS/v
SlHAHH5blR0kAVRvw3QZKgFoec+SzWaWPKHfC5Riqi/fcK91cEOtuGHpTz8KguO5
53pIWI+m2POBcoV4OiKbFCrvRvwmo5WDjiWpIU59379eX7ixIeSDRdrKdlc7lyuj
zuy8+Tz1B/ib6QDXdJcMM9jr0xhjLCFI6TxOYV3xnJ/JwkGOpVMeU0kn2mk11fPP
hjIWXt2/9zzpzla5Y/8RHSVgESNIiaxnBzqGSRzfMOrMY/6MnO8=
=ezfb
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 3 Oct 2022 19:41:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 03 15:41:54 2022
Received: from localhost ([127.0.0.1]:51752 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ofRK6-0001PC-7i
	for submit <at> debbugs.gnu.org; Mon, 03 Oct 2022 15:41:54 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33032)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ofRK4-0001Ox-0a
 for 57607 <at> debbugs.gnu.org; Mon, 03 Oct 2022 15:41:53 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49670)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ofRJy-0005Ct-Pw; Mon, 03 Oct 2022 15:41:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=5vUdb6fdIrdmCO0yY4k7NXVfwXO2JiLytfYpu4e5f8U=; b=POl+jZe89GV+
 8gyzASKSnaZ99M09/j4wC+1YR1xSraLH7s6giC/URAUjYtbskHLwLqNjnfT3QV8YcOv5FLUQP81ls
 GmSFuRJkbn6Gw8bWkbqS4UZpPiPEezC5GCnrJ6PSAvBT0BfYg81yyZIpxAKA2/17bum0jtgfPp99n
 QeXFYbb1FFrRIwhMLTaeqqJajl6vqAWjQrW/9QiE6dwLNKHyNGMArSwCWhsRcypciiS2hkR3Az2/a
 R+gwXwDDMR2/eE+8ppg0rtN107gBvnJlbd0m27pIQY3cdiNyj4zM2GcdRymKquCqcaYPiGymVBbp7
 HwN4vIWMxiv5J6uIP53hQw==;
Received: from [87.69.77.57] (port=1433 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ofRJx-0002wR-KB; Mon, 03 Oct 2022 15:41:46 -0400
Date: Mon, 03 Oct 2022 22:41:39 +0300
Message-Id: <83y1twwv7w.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Akib Azmain Turja <akib@HIDDEN>
In-Reply-To: <87r0zpi9za.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#57607: Feature request: Use the character cell on bottom-right
 corner of a terminal
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <87r0zpi9za.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57607
Cc: gerd.moellmann@HIDDEN, 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: gerd.moellmann@HIDDEN
> Date: Mon, 03 Oct 2022 14:31:53 +0600
> From:  Akib Azmain Turja via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> I have implemented it.  Implementing it was easier than I thought.  Here
> is the patch:

Thanks.  But could you please describe the idea of the patch in some
comment?  It is hard to follow the code, especially since the diff has
many pure whitespace changes.

Also, this:

> +      /* Go to the previous position. */
> +      cmgoto (tty, curY (tty), curX (tty) - 1);
> +      cmplus (tty, 1);

Seem to assume the last character takes just one column?  What about
characters whose width is 2 columns?

And finally, it would be nice to avoid so much code duplication
between tty_write_glyphs and tty_write_glyphs_with_face.  Is that
feasible?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 3 Oct 2022 09:21:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 03 05:21:27 2022
Received: from localhost ([127.0.0.1]:48980 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ofHde-0006yR-HY
	for submit <at> debbugs.gnu.org; Mon, 03 Oct 2022 05:21:27 -0400
Received: from knopi.disroot.org ([178.21.23.139]:45774)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1ofHdb-0006yE-Lz
 for 57607 <at> debbugs.gnu.org; Mon, 03 Oct 2022 05:21:25 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 11B884C2EC;
 Mon,  3 Oct 2022 11:21:22 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id AJ4koe02CySF; Mon,  3 Oct 2022 11:21:20 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1664788880; bh=QjmkHOLZrBZJlapJ7td8aDKqsw3SZTxFMvKLwZ6CxoE=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=KsnSQNnI6cNDr8UMn+K+1KFcZ1lQ2z14pFITNbfP2PoQNkx5z3fWhG7hXyY4txHvD
 P/8ZWvKTG2onL5s8y/PdHgUPV5XJ51bjEvf9rgoJZYa84eED+STZneglZMastycXol
 KN0966XES7ltwLJWUSNZmX0EZTE7XDg0a4AIefga6C8LMyWj2YaFvnr/uVRpHY469T
 vzfXfQppv/BYWRrF5UW0pzIbBWII9q6NYecT9CoCX6YRAc1T61Q1MPV1CBq2KlenV8
 FsJVIOOgDh6Nfy1f2rOymlaZGt8Tib6sp8oQMt2uQHjgBWN8dwnDraV03c4abXDA/K
 YlkvUaNQSjqZw==
To: Akib Azmain Turja via "Bug reports for GNU Emacs, the Swiss army knife
 of text editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <87tu5i9kbg.fsf@HIDDEN> (Akib Azmain Turja via's message of
 "Thu, 08 Sep 2022 17:28:35 +0600")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
Date: Mon, 03 Oct 2022 14:31:53 +0600
Message-ID: <87r0zpi9za.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="==-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>,
 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--==-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Akib Azmain Turja via "Bug reports for GNU Emacs, the Swiss army knife
of text editors" <bug-gnu-emacs@HIDDEN> writes:

> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>
>> Akib Azmain Turja <akib@HIDDEN> writes:
>>
>>> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>>>
>>> I mean, what files to change in order to do this?  I think it's
>>> tty_write_glyphs and tty_write_glyphs_with_face in term.c.
>>
>> Are you interested in implementing something?  You could re-open this
>> bug then, no problem.  Or are you maybe just evaluating if you'd like to
>> do it?  Please give a hint.
>
> Yes, I'm interested, because I think it would help me understand how
> Emacs renders text in terminal, which would help me to implement child
> frame in terminal.  But I don't have the time to do it right now.  I
> hope I can start doing this by late October.
>

I have implemented it.  Implementing it was easier than I thought.  Here
is the patch:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-Write-on-the-bottom-right-character-cell-on-terminal.patch
Content-Transfer-Encoding: quoted-printable
Content-Description: Patch

From=2072af00d8610bdc194062b246aab0e38f22174aeb Mon Sep 17 00:00:00 2001
From: Akib Azmain Turja <akib@HIDDEN>
Date: Mon, 3 Oct 2022 14:18:59 +0600
Subject: [PATCH] Write on the bottom-right character cell on terminal

Correctly write on the bottom-right character cell on text terminals
if the terminal allows to do this.  Also fixes bug#57728.

* src/term.c (tty_write_glyphs, tty_write_glyphs_with_face): Write on
the bottom-right character cell if the terminal supports it.

* src/term.c (glyph_on_char_cell_before_last): New static variable to
hold the current glyph on the character cell before the cell on the
bottom-right corner.
=2D--
 src/term.c | 266 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 225 insertions(+), 41 deletions(-)

diff --git a/src/term.c b/src/term.c
index 2e43d892..283a65c4 100644
=2D-- a/src/term.c
+++ b/src/term.c
@@ -718,7 +718,7 @@ encode_terminal_code (struct glyph *src, int src_len,
   return (encode_terminal_dst);
 }
=20
=2D
+static struct glyph glyph_on_char_cell_before_last;
=20
 /* An implementation of write_glyphs for termcap frames. */
=20
@@ -727,7 +727,7 @@ tty_write_glyphs (struct frame *f, struct glyph *string=
, int len)
 {
   unsigned char *conversion_buffer;
   struct coding_system *coding;
=2D  int n, stringlen;
+  int n, stringlen, write_on_last_cell;
=20
   struct tty_display_info *tty =3D FRAME_TTY (f);
=20
@@ -737,55 +737,158 @@ tty_write_glyphs (struct frame *f, struct glyph *str=
ing, int len)
   /* Don't dare write in last column of bottom line, if Auto-Wrap,
      since that would scroll the whole frame on some terminals.  */
=20
=2D  if (AutoWrap (tty)
=2D      && curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
=2D      && (curX (tty) + len) =3D=3D FRAME_COLS (f))
+  write_on_last_cell =3D (AutoWrap (tty)
+			&& curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
+			&& (curX (tty) + len) =3D=3D FRAME_COLS (f));
+  if (write_on_last_cell)
     len --;
=2D  if (len <=3D 0)
=2D    return;
=20
=2D  cmplus (tty, len);
+  if (FRAME_COLS (f) =3D=3D 1
+      || !(tty->TS_ins_char || tty->TS_ins_multi_chars
+	   || (tty->TS_insert_mode && tty->TS_end_insert_mode)))
+    write_on_last_cell =3D false;
+
+  if (len <=3D 0 && !write_on_last_cell)
+    return;
=20
   /* If terminal_coding does any conversion, use it, otherwise use
      safe_terminal_coding.  We can't use CODING_REQUIRE_ENCODING here
      because it always return 1 if the member src_multibyte is 1.  */
=2D  coding =3D (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_E=
NCODING_MASK
+  coding =3D ((FRAME_TERMINAL_CODING (f)->common_flags
+	     & CODING_REQUIRE_ENCODING_MASK)
 	    ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
   /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
      the tail.  */
   coding->mode &=3D ~CODING_MODE_LAST_BLOCK;
=20
=2D  for (stringlen =3D len; stringlen !=3D 0; stringlen -=3D n)
+  if (len > 0)
     {
=2D      /* Identify a run of glyphs with the same face.  */
=2D      int face_id =3D string->face_id;
+      cmplus (tty, len);
+
+      if (write_on_last_cell)
+	glyph_on_char_cell_before_last =3D string[len - 1];
+
+      for (stringlen =3D len; stringlen !=3D 0; stringlen -=3D n)
+	{
+	  /* Identify a run of glyphs with the same face.  */
+	  int face_id =3D string->face_id;
+
+	  for (n =3D 1; n < stringlen; ++n)
+	    if (string[n].face_id !=3D face_id)
+	      break;
+
+	  /* Turn appearance modes of the face of the run on.  */
+	  tty_highlight_if_desired (tty);
+	  turn_on_face (f, face_id);
=20
=2D      for (n =3D 1; n < stringlen; ++n)
=2D	if (string[n].face_id !=3D face_id)
=2D	  break;
+	  if (n =3D=3D stringlen && !write_on_last_cell)
+	    /* This is the last run.  */
+	    coding->mode |=3D CODING_MODE_LAST_BLOCK;
+	  conversion_buffer =3D encode_terminal_code (string, n,
+						    coding);
+	  if (coding->produced > 0)
+	    {
+	      block_input ();
+	      fwrite (conversion_buffer, 1, coding->produced,
+		      tty->output);
+	      clearerr (tty->output);
+	      if (tty->termscript)
+		fwrite (conversion_buffer, 1, coding->produced,
+			tty->termscript);
+	      unblock_input ();
+	    }
+	  string +=3D n;
=20
=2D      /* Turn appearance modes of the face of the run on.  */
+	  /* Turn appearance modes off.  */
+	  turn_off_face (f, face_id);
+	  tty_turn_off_highlight (tty);
+	}
+    }
+
+  /* Write on the bottom-right corner. */
+  if (write_on_last_cell)
+    {
+      /* Go to the previous position. */
+      cmgoto (tty, curY (tty), curX (tty) - 1);
+      cmplus (tty, 1);
+
+      int face_id =3D string->face_id;
+
+      /* Turn appearance modes of the face.  */
       tty_highlight_if_desired (tty);
       turn_on_face (f, face_id);
=20
=2D      if (n =3D=3D stringlen)
=2D	/* This is the last run.  */
=2D	coding->mode |=3D CODING_MODE_LAST_BLOCK;
=2D      conversion_buffer =3D encode_terminal_code (string, n, coding);
+      conversion_buffer =3D encode_terminal_code (string, 1, coding);
       if (coding->produced > 0)
 	{
 	  block_input ();
=2D	  fwrite (conversion_buffer, 1, coding->produced, tty->output);
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
 	  clearerr (tty->output);
 	  if (tty->termscript)
=2D	    fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
+	  unblock_input ();
+	}
+
+      /* Go to the previous position. */
+      cmgoto (tty, curY (tty), curX (tty) - 1);
+      cmplus (tty, 1);
+
+      /* Arrange that after writing the next glyph, the glyph on the
+         current character cell is somehow pushed to the bottom-right
+	 corner. */
+      if (tty->TS_ins_char)
+	{
+	  OUTPUT1 (tty, tty->TS_ins_char);
+	}
+      else if (tty->TS_ins_multi_chars)
+	{
+	  char *buf =3D tparam (tty->TS_ins_multi_chars, 0, 0, 1, 0,
+			      0, 0);
+	  OUTPUT1 (tty, buf);
+	  xfree (buf);
+	}
+      else
+	{
+	  tty_turn_on_insert (tty);
+	}
+
+      if (face_id !=3D glyph_on_char_cell_before_last.face_id)
+	{
+
+	  /* Turn appearance modes of the face.  */
+	  turn_off_face (f, face_id);
+	  tty_turn_off_highlight (tty);
+
+	  face_id =3D glyph_on_char_cell_before_last.face_id;
+
+	  tty_highlight_if_desired (tty);
+	  turn_on_face (f, face_id);
+	}
+
+      /* This is the last run.  */
+      coding->mode |=3D CODING_MODE_LAST_BLOCK;
+      conversion_buffer
+	=3D encode_terminal_code (&glyph_on_char_cell_before_last, 1,
+				coding);
+      if (coding->produced > 0)
+	{
+	  block_input ();
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
+	  clearerr (tty->output);
+	  if (tty->termscript)
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
 	  unblock_input ();
 	}
=2D      string +=3D n;
=20
       /* Turn appearance modes off.  */
       turn_off_face (f, face_id);
       tty_turn_off_highlight (tty);
+
+      tty_turn_off_insert (tty);
     }
=20
   cmcheckmagic (tty);
@@ -799,6 +902,7 @@ tty_write_glyphs_with_face (register struct frame *f, r=
egister struct glyph *str
 {
   unsigned char *conversion_buffer;
   struct coding_system *coding;
+  int write_on_last_cell;
=20
   struct tty_display_info *tty =3D FRAME_TTY (f);
=20
@@ -808,38 +912,118 @@ tty_write_glyphs_with_face (register struct frame *f=
, register struct glyph *str
   /* Don't dare write in last column of bottom line, if Auto-Wrap,
      since that would scroll the whole frame on some terminals.  */
=20
=2D  if (AutoWrap (tty)
=2D      && curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
=2D      && (curX (tty) + len) =3D=3D FRAME_COLS (f))
+  write_on_last_cell =3D (AutoWrap (tty)
+			&& curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
+			&& (curX (tty) + len) =3D=3D FRAME_COLS (f));
+  if (write_on_last_cell)
     len --;
=2D  if (len <=3D 0)
=2D    return;
=20
=2D  cmplus (tty, len);
+  if (FRAME_COLS (f) =3D=3D 1
+      || !(tty->TS_ins_char || tty->TS_ins_multi_chars
+	   || (tty->TS_insert_mode && tty->TS_end_insert_mode)))
+    write_on_last_cell =3D false;
+
+  if (len <=3D 0 && !write_on_last_cell)
+    return;
=20
   /* If terminal_coding does any conversion, use it, otherwise use
      safe_terminal_coding.  We can't use CODING_REQUIRE_ENCODING here
      because it always return 1 if the member src_multibyte is 1.  */
=2D  coding =3D (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_E=
NCODING_MASK
+  coding =3D ((FRAME_TERMINAL_CODING (f)->common_flags
+	     & CODING_REQUIRE_ENCODING_MASK)
 	    ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
=2D  /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
=2D     the tail.  */
+
+  /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only
+     at the tail.  */
   coding->mode &=3D ~CODING_MODE_LAST_BLOCK;
=20
   /* Turn appearance modes of the face.  */
   tty_highlight_if_desired (tty);
   turn_on_face (f, face_id);
=20
=2D  coding->mode |=3D CODING_MODE_LAST_BLOCK;
=2D  conversion_buffer =3D encode_terminal_code (string, len, coding);
=2D  if (coding->produced > 0)
+  if (len > 0)
+    {
+      cmplus (tty, len);
+      if (write_on_last_cell)
+	glyph_on_char_cell_before_last =3D string[len - 1];
+      else
+	coding->mode |=3D CODING_MODE_LAST_BLOCK;
+
+      conversion_buffer =3D encode_terminal_code (string, len, coding);
+      if (coding->produced > 0)
+	{
+	  block_input ();
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
+	  clearerr (tty->output);
+	  if (tty->termscript)
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
+	  unblock_input ();
+	}
+    }
+
+  /* Write on the bottom-right corner. */
+  if (write_on_last_cell)
     {
=2D      block_input ();
=2D      fwrite (conversion_buffer, 1, coding->produced, tty->output);
=2D      clearerr (tty->output);
=2D      if (tty->termscript)
=2D	fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
=2D      unblock_input ();
+      /* Go to the previous position. */
+      cmgoto (tty, curY (tty), curX (tty) - 1);
+      cmplus (tty, 1);
+
+      conversion_buffer =3D encode_terminal_code (string, 1, coding);
+      if (coding->produced > 0)
+	{
+	  block_input ();
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
+	  clearerr (tty->output);
+	  if (tty->termscript)
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
+	  unblock_input ();
+	}
+
+      /* Go to the previous position. */
+      cmgoto (tty, curY (tty), curX (tty) - 1);
+      cmplus (tty, 1);
+
+      /* Arrange that after writing the next glyph, the glyph on the
+         current character cell is somehow pushed to the bottom-right
+	 corner. */
+      if (tty->TS_ins_char)
+	{
+	  OUTPUT1 (tty, tty->TS_ins_char);
+	}
+      else if (tty->TS_ins_multi_chars)
+	{
+	  char *buf =3D tparam (tty->TS_ins_multi_chars, 0, 0, 1,
+			      0, 0, 0);
+	  OUTPUT1 (tty, buf);
+	  xfree (buf);
+	}
+      else
+	{
+	  tty_turn_on_insert (tty);
+	}
+
+      /* This is the last run.  */
+      coding->mode |=3D CODING_MODE_LAST_BLOCK;
+      conversion_buffer
+	=3D encode_terminal_code (&glyph_on_char_cell_before_last, 1,
+				coding);
+      if (coding->produced > 0)
+	{
+	  block_input ();
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
+	  clearerr (tty->output);
+	  if (tty->termscript)
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
+	  unblock_input ();
+	}
+
+      tty_turn_off_insert (tty);
     }
=20
   /* Turn appearance modes off.  */
=2D-=20
2.37.1


--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable


>>
>> The places you mention sound right.  It's probably all in term.c.  But
>> I'd like to add, that in principle all places writing to the terminal
>> have to be checked at least.
>>
>> And corner cases have to be taken into consideration :-).  Pulling
>> something out of thin air: What happens if we write RGRG to the
>> bottom-right corner, where R is one red char, and G is 1 green char,
>> say.

I tried "RGRG\", where "R" is red, "G" is green, and "\" is the (white)
continuation glyph.  Looks like this patch also fixes bug#57728.

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=--

--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmM6nfkACgkQVTX89U2I
YWuGcRAAlFVIzp63r3NHprQ5tvwPj+SmJUlcLwl7SDPN1PIWBAqPwqFlLkARVjpq
KfhRp21qM5F6gZMqyXV9qQI2prNJIHrsV9UIfuYax/67z/o6fhoBkALbmH4ezUy5
orBMdoQ7ZWBWtoLTm3Xkh4MVqgPWYUznvORh3S0o4xrlS9IgVoFXfgKzOsvTHnRn
MJkQOnxLv9va1ihs1x4enJX+LvE81WQyjstRtxRm/AXJLinfIYRUobqBq6d1ZLYw
RrJJ0tmBm1yOxlvVullCy2j6KLyzCLsYSLCxvQUYsOIYQvwaCexVy5UPLxxB2Z5R
NGjN5QgckSboEkMPK3uhPRSWUKak3/POdhBk6NEsEc6DcPgQw9BT+F+QgLOqj2tf
CbXdfevuC49NP1f2lL5kmIykwiL33kqEMp0zUu4HtEsjU2GZalhEU27bStxGuCQI
ETc4O+uPCxln5YOMRTaPA5H624BMXbnzujY1/Z1lrU9nFb/7XHk/BCIFgZ2sdlb0
u5f2FQB0ypJ8yNLbjvvsLbkKbb/BgmGXyeyUgKPQrEpom1OqzXKMYZya0J/SjOqF
IXaI4+bCsi4t06evWeBZli4B5TJOAhEZBoaiBiaOvxWxvFSgavOR+Gkz5JN80PTc
KuRc9XMdUWhjWJ8fTyhK/v/ow81sq3oIDoPiEL59n0b+NpijctE=
=LwLw
-----END PGP SIGNATURE-----
--==-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Oct 2022 09:21:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 03 05:21:53 2022
Received: from localhost ([127.0.0.1]:48983 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ofHe4-0006z3-IE
	for submit <at> debbugs.gnu.org; Mon, 03 Oct 2022 05:21:53 -0400
Received: from lists.gnu.org ([209.51.188.17]:37002)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1ofHe2-0006yw-TA
 for submit <at> debbugs.gnu.org; Mon, 03 Oct 2022 05:21:52 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40598)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <akib@HIDDEN>) id 1ofHe1-00032Z-5V
 for bug-gnu-emacs@HIDDEN; Mon, 03 Oct 2022 05:21:50 -0400
Received: from knopi.disroot.org ([178.21.23.139]:50882)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <akib@HIDDEN>) id 1ofHdy-0008Ix-2z
 for bug-gnu-emacs@HIDDEN; Mon, 03 Oct 2022 05:21:48 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 11B884C2EC;
 Mon,  3 Oct 2022 11:21:22 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id AJ4koe02CySF; Mon,  3 Oct 2022 11:21:20 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1664788880; bh=QjmkHOLZrBZJlapJ7td8aDKqsw3SZTxFMvKLwZ6CxoE=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=KsnSQNnI6cNDr8UMn+K+1KFcZ1lQ2z14pFITNbfP2PoQNkx5z3fWhG7hXyY4txHvD
 P/8ZWvKTG2onL5s8y/PdHgUPV5XJ51bjEvf9rgoJZYa84eED+STZneglZMastycXol
 KN0966XES7ltwLJWUSNZmX0EZTE7XDg0a4AIefga6C8LMyWj2YaFvnr/uVRpHY469T
 vzfXfQppv/BYWRrF5UW0pzIbBWII9q6NYecT9CoCX6YRAc1T61Q1MPV1CBq2KlenV8
 FsJVIOOgDh6Nfy1f2rOymlaZGt8Tib6sp8oQMt2uQHjgBWN8dwnDraV03c4abXDA/K
 YlkvUaNQSjqZw==
To: Akib Azmain Turja via "Bug reports for GNU Emacs, the Swiss army knife
 of text editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <87tu5i9kbg.fsf@HIDDEN> (Akib Azmain Turja via's message of
 "Thu, 08 Sep 2022 17:28:35 +0600")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
Date: Mon, 03 Oct 2022 14:31:53 +0600
Message-ID: <87r0zpi9za.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="==-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
Received-SPF: pass client-ip=178.21.23.139; envelope-from=akib@HIDDEN;
 helo=knopi.disroot.org
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
Cc: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>,
 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--==-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Akib Azmain Turja via "Bug reports for GNU Emacs, the Swiss army knife
of text editors" <bug-gnu-emacs@HIDDEN> writes:

> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>
>> Akib Azmain Turja <akib@HIDDEN> writes:
>>
>>> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>>>
>>> I mean, what files to change in order to do this?  I think it's
>>> tty_write_glyphs and tty_write_glyphs_with_face in term.c.
>>
>> Are you interested in implementing something?  You could re-open this
>> bug then, no problem.  Or are you maybe just evaluating if you'd like to
>> do it?  Please give a hint.
>
> Yes, I'm interested, because I think it would help me understand how
> Emacs renders text in terminal, which would help me to implement child
> frame in terminal.  But I don't have the time to do it right now.  I
> hope I can start doing this by late October.
>

I have implemented it.  Implementing it was easier than I thought.  Here
is the patch:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-Write-on-the-bottom-right-character-cell-on-terminal.patch
Content-Transfer-Encoding: quoted-printable
Content-Description: Patch

From=2072af00d8610bdc194062b246aab0e38f22174aeb Mon Sep 17 00:00:00 2001
From: Akib Azmain Turja <akib@HIDDEN>
Date: Mon, 3 Oct 2022 14:18:59 +0600
Subject: [PATCH] Write on the bottom-right character cell on terminal

Correctly write on the bottom-right character cell on text terminals
if the terminal allows to do this.  Also fixes bug#57728.

* src/term.c (tty_write_glyphs, tty_write_glyphs_with_face): Write on
the bottom-right character cell if the terminal supports it.

* src/term.c (glyph_on_char_cell_before_last): New static variable to
hold the current glyph on the character cell before the cell on the
bottom-right corner.
=2D--
 src/term.c | 266 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 225 insertions(+), 41 deletions(-)

diff --git a/src/term.c b/src/term.c
index 2e43d892..283a65c4 100644
=2D-- a/src/term.c
+++ b/src/term.c
@@ -718,7 +718,7 @@ encode_terminal_code (struct glyph *src, int src_len,
   return (encode_terminal_dst);
 }
=20
=2D
+static struct glyph glyph_on_char_cell_before_last;
=20
 /* An implementation of write_glyphs for termcap frames. */
=20
@@ -727,7 +727,7 @@ tty_write_glyphs (struct frame *f, struct glyph *string=
, int len)
 {
   unsigned char *conversion_buffer;
   struct coding_system *coding;
=2D  int n, stringlen;
+  int n, stringlen, write_on_last_cell;
=20
   struct tty_display_info *tty =3D FRAME_TTY (f);
=20
@@ -737,55 +737,158 @@ tty_write_glyphs (struct frame *f, struct glyph *str=
ing, int len)
   /* Don't dare write in last column of bottom line, if Auto-Wrap,
      since that would scroll the whole frame on some terminals.  */
=20
=2D  if (AutoWrap (tty)
=2D      && curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
=2D      && (curX (tty) + len) =3D=3D FRAME_COLS (f))
+  write_on_last_cell =3D (AutoWrap (tty)
+			&& curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
+			&& (curX (tty) + len) =3D=3D FRAME_COLS (f));
+  if (write_on_last_cell)
     len --;
=2D  if (len <=3D 0)
=2D    return;
=20
=2D  cmplus (tty, len);
+  if (FRAME_COLS (f) =3D=3D 1
+      || !(tty->TS_ins_char || tty->TS_ins_multi_chars
+	   || (tty->TS_insert_mode && tty->TS_end_insert_mode)))
+    write_on_last_cell =3D false;
+
+  if (len <=3D 0 && !write_on_last_cell)
+    return;
=20
   /* If terminal_coding does any conversion, use it, otherwise use
      safe_terminal_coding.  We can't use CODING_REQUIRE_ENCODING here
      because it always return 1 if the member src_multibyte is 1.  */
=2D  coding =3D (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_E=
NCODING_MASK
+  coding =3D ((FRAME_TERMINAL_CODING (f)->common_flags
+	     & CODING_REQUIRE_ENCODING_MASK)
 	    ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
   /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
      the tail.  */
   coding->mode &=3D ~CODING_MODE_LAST_BLOCK;
=20
=2D  for (stringlen =3D len; stringlen !=3D 0; stringlen -=3D n)
+  if (len > 0)
     {
=2D      /* Identify a run of glyphs with the same face.  */
=2D      int face_id =3D string->face_id;
+      cmplus (tty, len);
+
+      if (write_on_last_cell)
+	glyph_on_char_cell_before_last =3D string[len - 1];
+
+      for (stringlen =3D len; stringlen !=3D 0; stringlen -=3D n)
+	{
+	  /* Identify a run of glyphs with the same face.  */
+	  int face_id =3D string->face_id;
+
+	  for (n =3D 1; n < stringlen; ++n)
+	    if (string[n].face_id !=3D face_id)
+	      break;
+
+	  /* Turn appearance modes of the face of the run on.  */
+	  tty_highlight_if_desired (tty);
+	  turn_on_face (f, face_id);
=20
=2D      for (n =3D 1; n < stringlen; ++n)
=2D	if (string[n].face_id !=3D face_id)
=2D	  break;
+	  if (n =3D=3D stringlen && !write_on_last_cell)
+	    /* This is the last run.  */
+	    coding->mode |=3D CODING_MODE_LAST_BLOCK;
+	  conversion_buffer =3D encode_terminal_code (string, n,
+						    coding);
+	  if (coding->produced > 0)
+	    {
+	      block_input ();
+	      fwrite (conversion_buffer, 1, coding->produced,
+		      tty->output);
+	      clearerr (tty->output);
+	      if (tty->termscript)
+		fwrite (conversion_buffer, 1, coding->produced,
+			tty->termscript);
+	      unblock_input ();
+	    }
+	  string +=3D n;
=20
=2D      /* Turn appearance modes of the face of the run on.  */
+	  /* Turn appearance modes off.  */
+	  turn_off_face (f, face_id);
+	  tty_turn_off_highlight (tty);
+	}
+    }
+
+  /* Write on the bottom-right corner. */
+  if (write_on_last_cell)
+    {
+      /* Go to the previous position. */
+      cmgoto (tty, curY (tty), curX (tty) - 1);
+      cmplus (tty, 1);
+
+      int face_id =3D string->face_id;
+
+      /* Turn appearance modes of the face.  */
       tty_highlight_if_desired (tty);
       turn_on_face (f, face_id);
=20
=2D      if (n =3D=3D stringlen)
=2D	/* This is the last run.  */
=2D	coding->mode |=3D CODING_MODE_LAST_BLOCK;
=2D      conversion_buffer =3D encode_terminal_code (string, n, coding);
+      conversion_buffer =3D encode_terminal_code (string, 1, coding);
       if (coding->produced > 0)
 	{
 	  block_input ();
=2D	  fwrite (conversion_buffer, 1, coding->produced, tty->output);
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
 	  clearerr (tty->output);
 	  if (tty->termscript)
=2D	    fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
+	  unblock_input ();
+	}
+
+      /* Go to the previous position. */
+      cmgoto (tty, curY (tty), curX (tty) - 1);
+      cmplus (tty, 1);
+
+      /* Arrange that after writing the next glyph, the glyph on the
+         current character cell is somehow pushed to the bottom-right
+	 corner. */
+      if (tty->TS_ins_char)
+	{
+	  OUTPUT1 (tty, tty->TS_ins_char);
+	}
+      else if (tty->TS_ins_multi_chars)
+	{
+	  char *buf =3D tparam (tty->TS_ins_multi_chars, 0, 0, 1, 0,
+			      0, 0);
+	  OUTPUT1 (tty, buf);
+	  xfree (buf);
+	}
+      else
+	{
+	  tty_turn_on_insert (tty);
+	}
+
+      if (face_id !=3D glyph_on_char_cell_before_last.face_id)
+	{
+
+	  /* Turn appearance modes of the face.  */
+	  turn_off_face (f, face_id);
+	  tty_turn_off_highlight (tty);
+
+	  face_id =3D glyph_on_char_cell_before_last.face_id;
+
+	  tty_highlight_if_desired (tty);
+	  turn_on_face (f, face_id);
+	}
+
+      /* This is the last run.  */
+      coding->mode |=3D CODING_MODE_LAST_BLOCK;
+      conversion_buffer
+	=3D encode_terminal_code (&glyph_on_char_cell_before_last, 1,
+				coding);
+      if (coding->produced > 0)
+	{
+	  block_input ();
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
+	  clearerr (tty->output);
+	  if (tty->termscript)
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
 	  unblock_input ();
 	}
=2D      string +=3D n;
=20
       /* Turn appearance modes off.  */
       turn_off_face (f, face_id);
       tty_turn_off_highlight (tty);
+
+      tty_turn_off_insert (tty);
     }
=20
   cmcheckmagic (tty);
@@ -799,6 +902,7 @@ tty_write_glyphs_with_face (register struct frame *f, r=
egister struct glyph *str
 {
   unsigned char *conversion_buffer;
   struct coding_system *coding;
+  int write_on_last_cell;
=20
   struct tty_display_info *tty =3D FRAME_TTY (f);
=20
@@ -808,38 +912,118 @@ tty_write_glyphs_with_face (register struct frame *f=
, register struct glyph *str
   /* Don't dare write in last column of bottom line, if Auto-Wrap,
      since that would scroll the whole frame on some terminals.  */
=20
=2D  if (AutoWrap (tty)
=2D      && curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
=2D      && (curX (tty) + len) =3D=3D FRAME_COLS (f))
+  write_on_last_cell =3D (AutoWrap (tty)
+			&& curY (tty) + 1 =3D=3D FRAME_TOTAL_LINES (f)
+			&& (curX (tty) + len) =3D=3D FRAME_COLS (f));
+  if (write_on_last_cell)
     len --;
=2D  if (len <=3D 0)
=2D    return;
=20
=2D  cmplus (tty, len);
+  if (FRAME_COLS (f) =3D=3D 1
+      || !(tty->TS_ins_char || tty->TS_ins_multi_chars
+	   || (tty->TS_insert_mode && tty->TS_end_insert_mode)))
+    write_on_last_cell =3D false;
+
+  if (len <=3D 0 && !write_on_last_cell)
+    return;
=20
   /* If terminal_coding does any conversion, use it, otherwise use
      safe_terminal_coding.  We can't use CODING_REQUIRE_ENCODING here
      because it always return 1 if the member src_multibyte is 1.  */
=2D  coding =3D (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_E=
NCODING_MASK
+  coding =3D ((FRAME_TERMINAL_CODING (f)->common_flags
+	     & CODING_REQUIRE_ENCODING_MASK)
 	    ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
=2D  /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
=2D     the tail.  */
+
+  /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only
+     at the tail.  */
   coding->mode &=3D ~CODING_MODE_LAST_BLOCK;
=20
   /* Turn appearance modes of the face.  */
   tty_highlight_if_desired (tty);
   turn_on_face (f, face_id);
=20
=2D  coding->mode |=3D CODING_MODE_LAST_BLOCK;
=2D  conversion_buffer =3D encode_terminal_code (string, len, coding);
=2D  if (coding->produced > 0)
+  if (len > 0)
+    {
+      cmplus (tty, len);
+      if (write_on_last_cell)
+	glyph_on_char_cell_before_last =3D string[len - 1];
+      else
+	coding->mode |=3D CODING_MODE_LAST_BLOCK;
+
+      conversion_buffer =3D encode_terminal_code (string, len, coding);
+      if (coding->produced > 0)
+	{
+	  block_input ();
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
+	  clearerr (tty->output);
+	  if (tty->termscript)
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
+	  unblock_input ();
+	}
+    }
+
+  /* Write on the bottom-right corner. */
+  if (write_on_last_cell)
     {
=2D      block_input ();
=2D      fwrite (conversion_buffer, 1, coding->produced, tty->output);
=2D      clearerr (tty->output);
=2D      if (tty->termscript)
=2D	fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
=2D      unblock_input ();
+      /* Go to the previous position. */
+      cmgoto (tty, curY (tty), curX (tty) - 1);
+      cmplus (tty, 1);
+
+      conversion_buffer =3D encode_terminal_code (string, 1, coding);
+      if (coding->produced > 0)
+	{
+	  block_input ();
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
+	  clearerr (tty->output);
+	  if (tty->termscript)
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
+	  unblock_input ();
+	}
+
+      /* Go to the previous position. */
+      cmgoto (tty, curY (tty), curX (tty) - 1);
+      cmplus (tty, 1);
+
+      /* Arrange that after writing the next glyph, the glyph on the
+         current character cell is somehow pushed to the bottom-right
+	 corner. */
+      if (tty->TS_ins_char)
+	{
+	  OUTPUT1 (tty, tty->TS_ins_char);
+	}
+      else if (tty->TS_ins_multi_chars)
+	{
+	  char *buf =3D tparam (tty->TS_ins_multi_chars, 0, 0, 1,
+			      0, 0, 0);
+	  OUTPUT1 (tty, buf);
+	  xfree (buf);
+	}
+      else
+	{
+	  tty_turn_on_insert (tty);
+	}
+
+      /* This is the last run.  */
+      coding->mode |=3D CODING_MODE_LAST_BLOCK;
+      conversion_buffer
+	=3D encode_terminal_code (&glyph_on_char_cell_before_last, 1,
+				coding);
+      if (coding->produced > 0)
+	{
+	  block_input ();
+	  fwrite (conversion_buffer, 1, coding->produced,
+		  tty->output);
+	  clearerr (tty->output);
+	  if (tty->termscript)
+	    fwrite (conversion_buffer, 1, coding->produced,
+		    tty->termscript);
+	  unblock_input ();
+	}
+
+      tty_turn_off_insert (tty);
     }
=20
   /* Turn appearance modes off.  */
=2D-=20
2.37.1


--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable


>>
>> The places you mention sound right.  It's probably all in term.c.  But
>> I'd like to add, that in principle all places writing to the terminal
>> have to be checked at least.
>>
>> And corner cases have to be taken into consideration :-).  Pulling
>> something out of thin air: What happens if we write RGRG to the
>> bottom-right corner, where R is one red char, and G is 1 green char,
>> say.

I tried "RGRG\", where "R" is red, "G" is green, and "\" is the (white)
continuation glyph.  Looks like this patch also fixes bug#57728.

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=--

--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmM6nfkACgkQVTX89U2I
YWuGcRAAlFVIzp63r3NHprQ5tvwPj+SmJUlcLwl7SDPN1PIWBAqPwqFlLkARVjpq
KfhRp21qM5F6gZMqyXV9qQI2prNJIHrsV9UIfuYax/67z/o6fhoBkALbmH4ezUy5
orBMdoQ7ZWBWtoLTm3Xkh4MVqgPWYUznvORh3S0o4xrlS9IgVoFXfgKzOsvTHnRn
MJkQOnxLv9va1ihs1x4enJX+LvE81WQyjstRtxRm/AXJLinfIYRUobqBq6d1ZLYw
RrJJ0tmBm1yOxlvVullCy2j6KLyzCLsYSLCxvQUYsOIYQvwaCexVy5UPLxxB2Z5R
NGjN5QgckSboEkMPK3uhPRSWUKak3/POdhBk6NEsEc6DcPgQw9BT+F+QgLOqj2tf
CbXdfevuC49NP1f2lL5kmIykwiL33kqEMp0zUu4HtEsjU2GZalhEU27bStxGuCQI
ETc4O+uPCxln5YOMRTaPA5H624BMXbnzujY1/Z1lrU9nFb/7XHk/BCIFgZ2sdlb0
u5f2FQB0ypJ8yNLbjvvsLbkKbb/BgmGXyeyUgKPQrEpom1OqzXKMYZya0J/SjOqF
IXaI4+bCsi4t06evWeBZli4B5TJOAhEZBoaiBiaOvxWxvFSgavOR+Gkz5JN80PTc
KuRc9XMdUWhjWJ8fTyhK/v/ow81sq3oIDoPiEL59n0b+NpijctE=
=LwLw
-----END PGP SIGNATURE-----
--==-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 11 Sep 2022 10:40:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 11 06:40:14 2022
Received: from localhost ([127.0.0.1]:40828 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXKNq-00022E-Ig
	for submit <at> debbugs.gnu.org; Sun, 11 Sep 2022 06:40:14 -0400
Received: from knopi.disroot.org ([178.21.23.139]:42808)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1oXKNp-000224-ED
 for 57607 <at> debbugs.gnu.org; Sun, 11 Sep 2022 06:40:14 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id C548D4A037;
 Sun, 11 Sep 2022 12:40:11 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 40RWvk_DgGW4; Sun, 11 Sep 2022 12:40:10 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1662892810; bh=I33qbTeRum/SWf2o9AKHvuixgNv3+tkQT8rhwxAAid4=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=DRKnBRnqGEYlxUw5799ohiNRoHOunfrgrEYcMFsmI0GFy1w6O10UboxnvlR2Rrz8e
 WZjCTZmx2GmCwb1GQxuXiYxDLXiEucKB945rf5Ksyn4rbA5v3pNX21dP8YDJfoBSck
 NzHpjwRdeRd6ni5BU0KRGSvY3lugAh4d6TysnDVs3Jp0o7cLktV9pynmaat+KwOAjc
 zV+WONt3rzx6MEhFRpeQFT9H9ovrOj2EgNvrfBm8gdg+CSnH2eekU44rmk4Xz2fGRB
 +luoUP4ZuVPzzIyaDRJN0IDgutaiHhSOck5r2uj1Dj+C3nFcVlALq7tJLa4/zTlH5D
 5xrusJn5nwQHA==
To: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <25391635-bb04-94e5-97e2-a73ebd211378@HIDDEN> ("Gerd
 =?utf-8?Q?M=C3=B6llmann=22's?= message of "Sun, 11 Sep 2022 12:08:09
 +0200")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <m2edwm3uyk.fsf@HIDDEN> <87y1ut9b3b.fsf@HIDDEN>
 <87zgf6475h.fsf@HIDDEN>
 <25391635-bb04-94e5-97e2-a73ebd211378@HIDDEN>
Date: Sun, 11 Sep 2022 16:39:58 +0600
Message-ID: <87r10i42kh.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> On 22-09-11 11:00 , Akib Azmain Turja wrote:
>> Should I report this as a bug?
>
> Yes, please.  Someone should take a look at this.
>

Done, see bug#57728.

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMduv4ACgkQVTX89U2I
YWtBQRAArcCwBzXEvfQN+zI7MT01J2/JmnV48ERwQ1x1WuAUn+a+OMhiWkn7nGE3
OAH77O7MHir9BCB7q7S3jMK0RIaHV4lUcBfUhvny0VzJNq1NKUeRr0l/T8AQ891Q
iNVACYVymXOug5jlgB2yImr0SThu3GPhQ8UfKCxp9B/cUM8SdV8j6q5/n6VQaISH
oC3npPfa7msaZ6hcHjjvph5Hz6x3cscRaz44U71Qd7fDkfUMf0oqaeh8paP1bPTe
/j/CcXm3D3Rv759JXrjZwGzKixYD+TFFvndL2oHBTm9B1ix4TAAkCcOW+ApcB/EB
hIijvVju9JDL/UZJ16+4nJzcsUG5+iZli2ST2CxIR8O753OJde3Xwu/pszOxMVgE
ti94WdY7xykhlC+HqkXR+DazfG0rRvQUJ4kGHYmsyHa6dJvfiXa0VsJ+DoovH7sa
ADVlA2P905fOzHegNzg/gQzcp7L6e8hhk4gmHJCVl98Gl3MPT6Zmc0vD6gqXUiJ7
3MnhDMMin9cXcDq3L4NnNdUPvlUk5RIdm6lzxvxsd8RwuLAPe+Z9OpUMWVnJDm0s
NWxIux8FOWQrIumPg7xhGD19MAkR3toT65KtmPwy9iU4OWmGp8o31rFZ/9CuVsxH
ROBDZj3KLFT7rhhTQBP1kIQHDsOH0+WuAM4gX2FycGq7N6+u4zA=
=uP1C
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 11 Sep 2022 10:08:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 11 06:08:19 2022
Received: from localhost ([127.0.0.1]:40763 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXJsx-0007Ka-1V
	for submit <at> debbugs.gnu.org; Sun, 11 Sep 2022 06:08:19 -0400
Received: from mail-ed1-f50.google.com ([209.85.208.50]:36667)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gerd.moellmann@HIDDEN>) id 1oXJsv-0007KN-DR
 for 57607 <at> debbugs.gnu.org; Sun, 11 Sep 2022 06:08:17 -0400
Received: by mail-ed1-f50.google.com with SMTP id e18so8817692edj.3
 for <57607 <at> debbugs.gnu.org>; Sun, 11 Sep 2022 03:08:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :from:to:cc:subject:date;
 bh=JX0jkEfOI6Fnbe3c/e8Qy7LVOSBThfMCPmUa6BYVtko=;
 b=qGGXoRGWvSK5X2rbCqwVQeDYbYkxreQvlUvNlZOgaTppDKAXp3E5fKXUn6WBIhucGt
 poiT9VkaGIkYAsc3DepBWpaEcsKRXAWgHEp2vIfNX5tnPler6ujdO4rkBbum3IdRnJKW
 ABduklMhXzkk4p9jJsfSMHqHFV5re8bFJFgVd5rKscCuU24U6fa6WD4U1Y9946O8DJKr
 Momt9AecgmxlDfqFWyK7oJkk8J1NKaanv7cX3HlArFPuLPx8zIjMlYhpZB3YyElAJsTI
 g4u9jIpjNhQ8Qa2ONMV2JeYNs34bKcfwlv7v8Kvmapyoaf6iYfCsKdgBgmaqiQW3rL2W
 8A8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date;
 bh=JX0jkEfOI6Fnbe3c/e8Qy7LVOSBThfMCPmUa6BYVtko=;
 b=3y/XSkUrLhw48t5jC086r13Xtq70POngYtVOzLUbo5LBk5dXdSUUMw4DvxqVcS8RS+
 2Plm/Z+0gwQHKmWaz0m/kD1v/RIdFxFdUd5rdN6ZQdWoVfBDZHCWeY6cNcTS1UXjtCWl
 aX2cY0kxSIDNGlRxZteeZZFjLeWNPI3sHeCZvBwYesM+8iy/Md08sOFnFJRAp11EQ8Di
 JyuVY7QmS075PiDdL2FHAEYtp078+cdbRhcxp65WetEL8ZWKq3nBRqu6TKFmV69pnKvE
 jXk/nz2vWdVVVczlXHmYqJExgmN+OR+ofABv0c3QrkZn2xiMFgaXqnBFgBjv9x09BwZj
 Yecg==
X-Gm-Message-State: ACgBeo1BbY21ERwD3j34jtVk5EXIQhwAkmo7TkrisWamZ4mErae+2bCQ
 mjtdDotVCbGbDeiqqZlhSpo=
X-Google-Smtp-Source: AA6agR7Nfn1Dp0pW+WpyvLgA+F957c+uLHTLnn+/l/ynKe1P5SjcBM2T388oAdph8ZSSuEQrzhmdsg==
X-Received: by 2002:a05:6402:2802:b0:43a:9098:55a0 with SMTP id
 h2-20020a056402280200b0043a909855a0mr18098746ede.179.1662890891461; 
 Sun, 11 Sep 2022 03:08:11 -0700 (PDT)
Received: from [192.168.178.21] (pd9e36635.dip0.t-ipconnect.de.
 [217.227.102.53]) by smtp.gmail.com with ESMTPSA id
 10-20020a170906218a00b00740f1a58e0bsm2866017eju.30.2022.09.11.03.08.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 11 Sep 2022 03:08:10 -0700 (PDT)
Message-ID: <25391635-bb04-94e5-97e2-a73ebd211378@HIDDEN>
Date: Sun, 11 Sep 2022 12:08:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
 Gecko/20100101 Thunderbird/91.13.0
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
Content-Language: en-US
To: Akib Azmain Turja <akib@HIDDEN>
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <m2edwm3uyk.fsf@HIDDEN> <87y1ut9b3b.fsf@HIDDEN>
 <87zgf6475h.fsf@HIDDEN>
From: =?UTF-8?Q?Gerd_M=c3=b6llmann?= <gerd.moellmann@HIDDEN>
In-Reply-To: <87zgf6475h.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 22-09-11 11:00 , Akib Azmain Turja wrote:
> Should I report this as a bug?

Yes, please.  Someone should take a look at this.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 11 Sep 2022 09:04:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 11 05:04:25 2022
Received: from localhost ([127.0.0.1]:40717 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXIt7-0005lh-0l
	for submit <at> debbugs.gnu.org; Sun, 11 Sep 2022 05:04:25 -0400
Received: from knopi.disroot.org ([178.21.23.139]:56986)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1oXIt2-0005lW-Jz
 for 57607 <at> debbugs.gnu.org; Sun, 11 Sep 2022 05:04:23 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id B55E04A01B;
 Sun, 11 Sep 2022 11:04:18 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id If2yZhTFRxwr; Sun, 11 Sep 2022 11:04:17 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1662887057; bh=rkoBeMeJlTuRiZd33fFM9b3mgWLa9RUqwiAk0WnSErw=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=mmwlNcPHm7xbiBamQkVlPYjh+bUfEjIFyPscve3BOifiuZoTH08jU3x9Kqe/JKLq6
 hunZvjF3LoFs1UK3DWww67O5fefyw1yHVIDNXJfPqbnVHkfz5/qPRMTfLYcEfhGekP
 efctPpHW2AOWnaT+ojaExrJOPxFvGHYl3eWMTNFF97+amY1+rUi6Y9P/XriYCtaK+W
 y4+d66ZxmEH8cZtziy59zxZpF25ebaHomHZR0U/O3vRGsCN61vqF8cVyqBXkL0GzHV
 PveiwDLFzDPsCUmmq8tL37Lo9lnCsIuuPLkgj2d8d3CZH9ye5KW5r57c+gs2NbjkAU
 cEBeESaN2MRTg==
To: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <87y1ut9b3b.fsf@HIDDEN> (Akib Azmain Turja's message of
 "Thu, 08 Sep 2022 20:47:52 +0600")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <m2edwm3uyk.fsf@HIDDEN> <87y1ut9b3b.fsf@HIDDEN>
Date: Sun, 11 Sep 2022 15:00:58 +0600
Message-ID: <87zgf6475h.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Akib Azmain Turja <akib@HIDDEN> writes:

> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>
>> Akib Azmain Turja <akib@HIDDEN> writes:
>>
>>> Yes, I'm interested, because I think it would help me understand how
>>> Emacs renders text in terminal, which would help me to implement child
>>> frame in terminal.  But I don't have the time to do it right now.  I
>>> hope I can start doing this by late October.
>>
>> Great!  I've re-opened this issue.
>>
>>>
>>>>
>>>> The places you mention sound right.  It's probably all in term.c.  But
>>>> I'd like to add, that in principle all places writing to the terminal
>>>> have to be checked at least.
>>>>
>>>> And corner cases have to be taken into consideration :-).  Pulling
>>>> something out of thin air: What happens if we write RGRG to the
>>>> bottom-right corner, where R is one red char, and G is 1 green char,
>>>> say.
>>>
>>> I think you meant the following in Bash:
>>>
>>> printf "%$((COLUMNS - 4))s\e[31mr\e[32mg\e7\e[32mg\e8\e[@\e[31mr\e[m" "=
" ; sleep 1 ; printf '\n'
>>>
>>> And it works on St, Kitty, Coterm, Term, etc.
>>
>> What I was thinking of is the Emacs side of things, i.e. can we always
>> do our magic locally in tty_write... etc., or is it sometimes necessary
>> to reorder writes at the caller.
>
> We would need to remember the glyph in the character cell before the
> last one, because modifying the last character cell needs to rewrite to
> that cell.

Just to add, terminal is with 'smam' (enable automatic margin) and
'rmam' (disable automatic margin) can disable automatic margin, thus can
write the last character cell.

And, Emacs currently often writes to the last character possibly by
mistake.  I'm not sure whether this is a bug or not.  To reproduce, run
emacs -Q, hit M-: (eval-expression), write some garbage until the
minibuffer window scrolls (I used (+ (% (random) 26) ?a) to generate
the garbage), and hit C-p until you scroll down a line.  You should now
see that the last character cell contains a continuation ('\') glyph.  I
think this is probably due to the use of 'il' or 'il1' or 'rin'
capability.  Should I report this as a bug?

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMdo8sACgkQVTX89U2I
YWsjwQ/9GyVFcq4J/F64EIPoMYHGMmWeRUgKljqSvlg1QAQHlph7ghhCodeoKlQo
H/8Jqc0RdUolqQ+V3jB19UF49BTqyhVAiAftKwTyqSoFd1wLLD4pV7pDbn7tZ0pP
8yjPjm/Zq1ZIbulgoQR8ayPnI46J02AOJKc/b/bt8bCV3xXeRSkRov/xYGOuGN36
d4e/gVd7TpPjNcjJu0XrMBVXRIyld6mlKwRO5tBXjYTVNB3nXzOEmLZ1iUWj92u0
8NOohB6m8xzQQWMDAiJQF+Qftoxz9EC0i2fcIazM6lyl5fgHouEpcDo0BAmrazTp
BuwcHr+5X02bOagqkaS+U7wZEEOtdQfN6G1n5R+9pqy4EuvsszsrUZolO2+CbUlh
OPau7usjtiqRJPzo+H8JKV+M5YJePX9Iq9SvVtfO0StbWKNvbeqi74XKviDia46X
fyuPivK1q8nknQLCqYXgAVruXAgL/HZ9z3s58VmUJD4RwqJVuJUI90yP2P8gVEjl
+1suLUSpeF7yafEYexjS2sg848I3nvDe0J5VsdnbxaQcaQTV2wIzmf6hf2nS7AFa
m5oO9E8783+Me/jOzsKJk8yqssICuYXsOqbItoiJzhzfiBERjz0xx3uduqPnNPVo
adWppzkrZBBqEVnG8Wz/xGgCY+wfroS5eIRaWcWMqXGW1xmdGYQ=
=OXne
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 8 Sep 2022 14:50:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 08 10:50:51 2022
Received: from localhost ([127.0.0.1]:59837 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oWIri-0005K2-R1
	for submit <at> debbugs.gnu.org; Thu, 08 Sep 2022 10:50:51 -0400
Received: from knopi.disroot.org ([178.21.23.139]:39718)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1oWIrh-0005Jt-Cw
 for 57607 <at> debbugs.gnu.org; Thu, 08 Sep 2022 10:50:50 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id C1CF549FB2;
 Thu,  8 Sep 2022 16:50:47 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with UTF8SMTP id NvLoMnlEgdlA; Thu,  8 Sep 2022 16:50:46 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1662648580; bh=7seP5L/pqt4b8TCrkblAXu8Tnuj1zzcf8Hs5U4jw7NA=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=XbGrDedeIxyEc6I1MlEzW87k1wzeffJv2Ln3EEKj/6KTu97/rT0Z7M7mhZK+2Qq5K
 Kkw3J/9HpSnvIgmuFOf1zhfpyNonHpt/0X+UAPvIec5Qd62s2SdsRR0IKtnIFffmpk
 aGFwMpAsMREc9LRxPWEgXw/7pFsSeMD0Et5mzEwcFF7pV7ohnbWasBL361NPpcdFZC
 QY98CxzbrfCthZE3o0LvdEBXvBBYECnYVCtx6WL4YyXlTS/84MgSA/tyn/9VxK/NBw
 7UmI8DGUO4imu9lJtT+k8d9ZRynuYl1m99bYx0I0yWC9iotvpezHvDUCepgnrAjOCj
 FgVccXcJZPiog==
To: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <m2edwm3uyk.fsf@HIDDEN> ("Gerd =?utf-8?Q?M=C3=B6llman?=
 =?utf-8?Q?n=22's?= message of "Thu, 08 Sep 2022 14:35:15 +0200")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
 <m2edwm3uyk.fsf@HIDDEN>
Date: Thu, 08 Sep 2022 20:47:52 +0600
Message-ID: <87y1ut9b3b.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Akib Azmain Turja <akib@HIDDEN> writes:
>
>> Yes, I'm interested, because I think it would help me understand how
>> Emacs renders text in terminal, which would help me to implement child
>> frame in terminal.  But I don't have the time to do it right now.  I
>> hope I can start doing this by late October.
>
> Great!  I've re-opened this issue.
>
>>
>>>
>>> The places you mention sound right.  It's probably all in term.c.  But
>>> I'd like to add, that in principle all places writing to the terminal
>>> have to be checked at least.
>>>
>>> And corner cases have to be taken into consideration :-).  Pulling
>>> something out of thin air: What happens if we write RGRG to the
>>> bottom-right corner, where R is one red char, and G is 1 green char,
>>> say.
>>
>> I think you meant the following in Bash:
>>
>> printf "%$((COLUMNS - 4))s\e[31mr\e[32mg\e7\e[32mg\e8\e[@\e[31mr\e[m" ""=
 ; sleep 1 ; printf '\n'
>>
>> And it works on St, Kitty, Coterm, Term, etc.
>
> What I was thinking of is the Emacs side of things, i.e. can we always
> do our magic locally in tty_write... etc., or is it sometimes necessary
> to reorder writes at the caller.

We would need to remember the glyph in the character cell before the
last one, because modifying the last character cell needs to rewrite to
that cell.

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMaAJkACgkQVTX89U2I
YWsplhAA33wCa8q2MZOFfoPucWrjuPj29O2B5C7iOl+LcvcZQ3aZQ6vq8PrOPqmX
GrPDO8L/RJ6CndwV1RrCIdqBEIrciMMCcn9KEGKnpU6P8m14aWC57X1MqngKkW8Y
ZrtkrfDet7oJA0AHGhVmnTlozcI4eQdNnLq5UjruygZBw/yfGUzVVagDYnfBcMen
v3hyHQoInGnJEou7LYYbVW1TIkAOzE9JvHPyF+T5Bw5MmqIegju0Tx+GkXUMooki
glXvmRzAW0/A8u8zh5ruKXhNg/f54lDghklB9z3/xN4l3LFHvBm8eXyQR+Gxi93W
TEin5e1ER5Mrk39GlskXaFRjC5M1GBA4X2yUnXRBRFbS2YQFpuE73BWhYxsQLvOS
A5GrBiyQZoXJ/7J4NOyaD1/+RdeslxCQs5WKp/M5CbJoL3DKUJYOgEjjYfceWYpZ
6PaXTjav+jFqba6/IZHixFZIX8fsWxmdXZ9eIAedKCzjoYI23fCeI5ZIDCScWyka
I7UeDqARZUfnkfeSQMIU/qeNPORSKPvTudWm3l2MOYXXLUVN/T4EI1suPliojjQe
+ZrbpVrvab0KiHRkcoxtARnjL3JXC0uv41RGie7zBVwvESFdHUy4bDQNqnlRyUo2
25oWB1ClqJmWO4YDCugJrFbJ3Dxcrfg1/4vmWjRxWCyeSchVdNw=
=Fq4H
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 8 Sep 2022 12:35:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 08 08:35:25 2022
Received: from localhost ([127.0.0.1]:57492 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oWGke-0006jd-PW
	for submit <at> debbugs.gnu.org; Thu, 08 Sep 2022 08:35:25 -0400
Received: from mail-wr1-f51.google.com ([209.85.221.51]:43713)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gerd.moellmann@HIDDEN>) id 1oWGkd-0006jN-AJ
 for 57607 <at> debbugs.gnu.org; Thu, 08 Sep 2022 08:35:23 -0400
Received: by mail-wr1-f51.google.com with SMTP id t7so20803102wrm.10
 for <57607 <at> debbugs.gnu.org>; Thu, 08 Sep 2022 05:35:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date;
 bh=t+nEN8r5trlGVs2T/xDwnm/66f5DZT99PajcwHW58Mw=;
 b=hl4PwX5alrzAZT/DR36qQ/AwK7K3DOOJIG1lxfwSOzBEY25PrV/P/thvNWUkeJIPa8
 SFPMCifjarKHGBdGbncLBKNIKpmeHPRoBqieEudaiZu81xDxH3dgWKw95zuHsMNRl6J0
 VARHFzpRLfIQLczrodPxVNx6ne/joudHidlU/wPiYsUSs+4x3Yi+cvHAzI96uk1+A/dq
 COuQQMaxIhUcyCOPqOAMKxuhcKvqleWfIBvgBKdlR68/44ZOI5VX09pZKc9uCuj+7JvK
 jL7QzbCHvjCD5btOWJyoXKUOozogLwoltEdspoi2DNJOhnenIlMfLhC2maL7e+v/1iF5
 b9DA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date;
 bh=t+nEN8r5trlGVs2T/xDwnm/66f5DZT99PajcwHW58Mw=;
 b=tqlKs9qZOJPUvE1OlISH59AGZ6vxnQe028lQLr1oZBGY4bTBw3IYx7VRheODg2vOOi
 7PaNx7wBEGDj2UEQrENh4L7L+CLNeQRl8MbYttNvFWgXsGw1yc7g2zlXWF1IlTBJ/cbN
 VqPq8As2wYwpP6MXiyq8SIxkz9g9mMarWWGjSW6mN/1qcXamz9mpL/1lJ6ZhGRLS6nTD
 Zstq+/NLQU5z3wJeS6GR8OxpqYfZEFsbSKKdUa/6plnq2uE4rKNoZuiq0nE24AvZcXbP
 +WpgrshpwiF1TF7ZtR2b37AK3l1Gc9WNsnOwfDjKV7ZrFgk6aSdyM6vjRmuYr1WF19D7
 UC4w==
X-Gm-Message-State: ACgBeo0giYLfrQchkjq7s9V6gFKxw8Jo9I3z5i+INiY2wdG1OFRRo84g
 968xD1jA7eUREMpXXWSw5uTT6L88UdUdcQ==
X-Google-Smtp-Source: AA6agR6o/2xf2Ml9LUGh6kG2a+nn1IguJY9b6irAngMapE1985MTjkkq2En1U0rpkKDGaKYFg3ci+Q==
X-Received: by 2002:a05:6000:904:b0:21a:3dca:4297 with SMTP id
 bz4-20020a056000090400b0021a3dca4297mr4889314wrb.487.1662640517183; 
 Thu, 08 Sep 2022 05:35:17 -0700 (PDT)
Received: from Mini.fritz.box (pd9e367ac.dip0.t-ipconnect.de.
 [217.227.103.172]) by smtp.gmail.com with ESMTPSA id
 19-20020a05600c26d300b003a50924f1c0sm2339105wmv.18.2022.09.08.05.35.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Sep 2022 05:35:16 -0700 (PDT)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Akib Azmain Turja <akib@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <87tu5i9kbg.fsf@HIDDEN> (Akib Azmain Turja's message of
 "Thu, 08 Sep 2022 17:28:35 +0600")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN> <87tu5i9kbg.fsf@HIDDEN>
Date: Thu, 08 Sep 2022 14:35:15 +0200
Message-ID: <m2edwm3uyk.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Akib Azmain Turja <akib@HIDDEN> writes:

> Yes, I'm interested, because I think it would help me understand how
> Emacs renders text in terminal, which would help me to implement child
> frame in terminal.  But I don't have the time to do it right now.  I
> hope I can start doing this by late October.

Great!  I've re-opened this issue.

>
>>
>> The places you mention sound right.  It's probably all in term.c.  But
>> I'd like to add, that in principle all places writing to the terminal
>> have to be checked at least.
>>
>> And corner cases have to be taken into consideration :-).  Pulling
>> something out of thin air: What happens if we write RGRG to the
>> bottom-right corner, where R is one red char, and G is 1 green char,
>> say.
>
> I think you meant the following in Bash:
>
> printf "%$((COLUMNS - 4))s\e[31mr\e[32mg\e7\e[32mg\e8\e[@\e[31mr\e[m" "" ; sleep 1 ; printf '\n'
>
> And it works on St, Kitty, Coterm, Term, etc.

What I was thinking of is the Emacs side of things, i.e. can we always
do our magic locally in tty_write... etc., or is it sometimes necessary
to reorder writes at the caller.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.
bug No longer marked as fixed in versions 29.1 and reopened. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 8 Sep 2022 12:10:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 08 08:10:57 2022
Received: from localhost ([127.0.0.1]:57429 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oWGMw-00062E-2r
	for submit <at> debbugs.gnu.org; Thu, 08 Sep 2022 08:10:57 -0400
Received: from knopi.disroot.org ([178.21.23.139]:36212)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1oWGMi-00061o-Vb
 for 57607 <at> debbugs.gnu.org; Thu, 08 Sep 2022 08:10:52 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id BDD3649FF5;
 Thu,  8 Sep 2022 14:10:39 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id wSxW5hvTDuHh; Thu,  8 Sep 2022 14:10:38 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1662638929; bh=Me5+W3yfls8eKxpYNb8h85zbp+nSh0wS/RzVNfXsrBw=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=khDuNoo97WXId1wD+YeD+t4xWF8twrtObT7uqcJfV37aZr1kjyJSPZF0hd1HqQrmK
 pJCvuaFsjrU6hK+D0IZQTZnCdN8EyxJxe3Uct+0TptpRL61i3Oc+WrAiYOpaGbmktj
 Iis6M9AyjzjIffOUMC2eK1/SCDtgRYsWqjZpL20I/09vGcWZ6v3/F3Cuq5fFKP93QF
 n85q8DBypWz5xhI123hzDhUOp0lwLV9qHIRgHf/I7g5ZFfmcHDI66raDg9DehhWEn/
 IsgdLOSSB56Z3bcJDqQUJZzgE78NLQ4I7oTD4EFpYJ2TGc4638UldKqGq9Y0RRf7Ry
 OK7IlwhkakuMA==
To: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <m2v8py4dqf.fsf@HIDDEN> ("Gerd =?utf-8?Q?M=C3=B6llman?=
 =?utf-8?Q?n=22's?= message of "Thu, 08 Sep 2022 07:49:44 +0200")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
 <m2v8py4dqf.fsf@HIDDEN>
Date: Thu, 08 Sep 2022 17:28:35 +0600
Message-ID: <87tu5i9kbg.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Akib Azmain Turja <akib@HIDDEN> writes:
>
>> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>>
>> I mean, what files to change in order to do this?  I think it's
>> tty_write_glyphs and tty_write_glyphs_with_face in term.c.
>
> Are you interested in implementing something?  You could re-open this
> bug then, no problem.  Or are you maybe just evaluating if you'd like to
> do it?  Please give a hint.

Yes, I'm interested, because I think it would help me understand how
Emacs renders text in terminal, which would help me to implement child
frame in terminal.  But I don't have the time to do it right now.  I
hope I can start doing this by late October.

>
> The places you mention sound right.  It's probably all in term.c.  But
> I'd like to add, that in principle all places writing to the terminal
> have to be checked at least.
>
> And corner cases have to be taken into consideration :-).  Pulling
> something out of thin air: What happens if we write RGRG to the
> bottom-right corner, where R is one red char, and G is 1 green char,
> say.

I think you meant the following in Bash:

=2D-8<---------------cut here---------------start------------->8---
printf "%$((COLUMNS - 4))s\e[31mr\e[32mg\e7\e[32mg\e8\e[@\e[31mr\e[m" "" ; =
sleep 1 ; printf '\n'
=2D-8<---------------cut here---------------end--------------->8---

And it works on St, Kitty, Coterm, Term, etc.

>
> And maybe we have to check for characters that are more than 1 column
> wide?  I don't remember something like that from when I last worked in
> this area, but I'd check what the situation is nowadays.
>
> That's all I can say without studying the code more in detail, which I'm
> trying to avoid :-).
>

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMZ0eQACgkQVTX89U2I
YWv+LBAAhcMUhS3MCesysJu8tOeKsIb1vUzgdRAi8dUBvCLt9pTvSzt8hM8qiQcV
p4lQb/Rpv87VUUqoQtKSVb3wofzQM9SVvVoPgFLrY0f9t//b3s9O7ZxaKNwz+5NA
EF/ETaAATskOiJ37U51KpvySsxCZG7seJwYxdrusscuODRsdLOSQT4u4nNeNr+2y
pXU3oahlD31bGAekdiCewk2qCIPznon0iRNjmTdYuKJu+s9RFzt9taxbeE5s7PZ7
0PPNHu0yAMyb6hBLmrTroS+rJUjr3MWYS9oVbDAorAti1FhJ1aQvoIzxjUAfQ6sj
LJ6t9zKUTgyD29yYHHywUjvgHCF2cNzoZ0VO64Zm6VPjhlcZU84bTO8ewgpUvW1l
hcB2y7K2D4U7zkvvbKDBZMH3WIZvLlDwmsdkqkjRdkuVcVAY+AKUPWjLDfJrQafV
cOZzwgZjaVzYEXWsZWt6jZY4dM8J49vk4E7wwvkPgRREafRledunSaCURuM0SCk0
gkp736ebWyXtcn3ZxkWiwrZ0Oio8dagKvxnx2+rUG6Bf0k/LWwBZelVjE3EKv+9u
qwM60flwRn/4j+JaPsaIphF4DCARyka8gRI1tgzjNBE/n/vInhzSXBGqQJwMrucq
L+8e+VSjkE3+XYR0pSJuW4wbfBSUJ8e8Y7ZhRNW2wmy53/cuTFQ=
=qrHo
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 8 Sep 2022 05:49:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 08 01:49:55 2022
Received: from localhost ([127.0.0.1]:56989 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oWAQF-0002HZ-0G
	for submit <at> debbugs.gnu.org; Thu, 08 Sep 2022 01:49:55 -0400
Received: from mail-ed1-f46.google.com ([209.85.208.46]:40680)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gerd.moellmann@HIDDEN>) id 1oWAQC-0002HL-OC
 for 57607 <at> debbugs.gnu.org; Thu, 08 Sep 2022 01:49:53 -0400
Received: by mail-ed1-f46.google.com with SMTP id m1so22716844edb.7
 for <57607 <at> debbugs.gnu.org>; Wed, 07 Sep 2022 22:49:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date;
 bh=IeMBDkHM2dxUkyOeu6kENBkS5BGsMHskbhVTo+3DxuA=;
 b=AP1dR4mtaYGO8lDrEyEIa7sAizOb3M2AzUSp/pDQ7YMkY6IQAq251Mtup1v6/32HcF
 TQh88+o5YOjKE5zCA5m93LETuj7JES9uKzeT2+/oqprWQtK68PsbSpsae1Dm82r+F6ED
 OQ4dE9PmCFaxbJfn+/obh5f6ZTzE3R0XVCdyLEWU/q+I3COFZMuVfUYBDLfd5S00eo/c
 KdgLLPSruohX4S1AFkeBlgngRmcm39F9lSSUjLKCXwjvn730DxDINVTtMhG43e1tppLQ
 oLX80tBuiR2W5AUW37IeD8RQrrtbEbtyQ1FO1vcUocjfIR1RvMvQcQM8K0pZ/y/4o/LB
 Gy2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date;
 bh=IeMBDkHM2dxUkyOeu6kENBkS5BGsMHskbhVTo+3DxuA=;
 b=MvMqhfr3L6ZOu+4+k4oCoJYLFTqRbYPNevi19jW6lcISNxBpGrUmRBHDlD9REf9vb1
 pP2oPftHixlJN8PiaTBVu9AfFaUF8dxeQ2WOufUP0ge1I4s7XE2Tiiqqytcjejx3FnNF
 MQjLuxZU6eMBIH4nwTjzS9gKDnsIt0hwHDYYm7aZ3vTr61QrFu1nk+IyxzsXujW+D+pJ
 jXsyczhfiYRQVRNjHhbiilRMmpjEo/lUbfdRCrxIYw+h0wAOOt3A9MGwHw+x9gcemJoI
 yT22aRFFEZPGvKX1r8TPY1MgzS7Y/tEreL17D9ksSqIGuVG6cqyKvsyLBVuY+gzdLydo
 gEAQ==
X-Gm-Message-State: ACgBeo2v+mrsWDNsQz+1fwQp6TsYfUhfq0v2HKgATheHZoqYQz4YFX2O
 2+kJoP+xWobF1Yi/puTmSmgdOvcYV7Mg1A==
X-Google-Smtp-Source: AA6agR4oniXrsGp7E5i/n44goTRwkjY5ItBlmfhxjHnJY1gecWvYqMKL4weffb1taaJBD81LmqJCOg==
X-Received: by 2002:a05:6402:27d0:b0:44e:c428:3d00 with SMTP id
 c16-20020a05640227d000b0044ec4283d00mr5546389ede.161.1662616186346; 
 Wed, 07 Sep 2022 22:49:46 -0700 (PDT)
Received: from Mini.fritz.box (pd9e367ac.dip0.t-ipconnect.de.
 [217.227.103.172]) by smtp.gmail.com with ESMTPSA id
 um28-20020a170906cf9c00b0076f927ed0f1sm749049ejb.127.2022.09.07.22.49.45
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 07 Sep 2022 22:49:45 -0700 (PDT)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Akib Azmain Turja <akib@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <874jxjhz9l.fsf@HIDDEN> (Akib Azmain Turja's message of
 "Wed, 07 Sep 2022 23:26:14 +0600")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <874jxjhz9l.fsf@HIDDEN>
Date: Thu, 08 Sep 2022 07:49:44 +0200
Message-ID: <m2v8py4dqf.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Akib Azmain Turja <akib@HIDDEN> writes:

> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>
> I mean, what files to change in order to do this?  I think it's
> tty_write_glyphs and tty_write_glyphs_with_face in term.c.

Are you interested in implementing something?  You could re-open this
bug then, no problem.  Or are you maybe just evaluating if you'd like to
do it?  Please give a hint.

The places you mention sound right.  It's probably all in term.c.  But
I'd like to add, that in principle all places writing to the terminal
have to be checked at least.

And corner cases have to be taken into consideration :-).  Pulling
something out of thin air: What happens if we write RGRG to the
bottom-right corner, where R is one red char, and G is 1 green char,
say.

And maybe we have to check for characters that are more than 1 column
wide?  I don't remember something like that from when I last worked in
this area, but I'd check what the situation is nowadays.

That's all I can say without studying the code more in detail, which I'm
trying to avoid :-).





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 7 Sep 2022 17:29:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 07 13:29:59 2022
Received: from localhost ([127.0.0.1]:56089 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVysB-0006H1-IT
	for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 13:29:59 -0400
Received: from knopi.disroot.org ([178.21.23.139]:34142)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1oVys9-0006Gs-MU
 for 57607 <at> debbugs.gnu.org; Wed, 07 Sep 2022 13:29:58 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 51F7C400AB;
 Wed,  7 Sep 2022 19:29:56 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 5BYQ0ipUBd5U; Wed,  7 Sep 2022 19:29:55 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1662571795; bh=80bfvlQdof5QTZ10Yv2+yYay4UJmYflpVt2QkB+xrW8=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=ZAU5U7ivf0L2kluagQPZ30gIH4tyHRg1KZRBT/XAKgGOg5iA0/fyzSjIcfS3JhSGE
 NA9im3oJw/nNUMv3W41Azv1y9hWNSV4JSmsOlc97Xdut0D2k1vZuWnQp07MIOqdzd5
 9zxYFTgtzbNZFsQ5j1mFrkG8EGCW+OTR88owWMGKMrjJmydMO5S4msI2eSN17YOPwX
 uOAaK8+6Q82AXtXSiw1CNMJ3fXUaIvNd5VORyEZQ1m0KZ7n/nXWObJX87YFu4TXToB
 yKxxwaztjXG/FHjoCHQkI35whQ3rn9o0UK8cAZU5MXnuAVld48VavaZv3cfk1Ky8rK
 aMZ3cq+Ob/UTQ==
To: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <m2sfl3g4ql.fsf@HIDDEN> ("Gerd =?utf-8?Q?M=C3=B6llman?=
 =?utf-8?Q?n=22's?= message of "Wed, 07 Sep 2022 06:58:42 +0200")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN>
Date: Wed, 07 Sep 2022 23:26:14 +0600
Message-ID: <874jxjhz9l.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

I mean, what files to change in order to do this?  I think it's
tty_write_glyphs and tty_write_glyphs_with_face in term.c.

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMY1DYACgkQVTX89U2I
YWtu2w/7BS6DEpVr/7vHVPS79DqiF949k2na/di4gcq62MKPz9kvqiI0VPjdkIbb
SS5mrtRSQjQiBaeG3FB+IzRjzPJSWe0dCp1/7Q5lI1mmTxrPcCqsqMHDBdpsatU1
3iruEAdU1Lw2OYu5bHF1DniXpTj1g0RQ+qYLc++fOLB3SHPOvCoP7EpHM8xvSQKs
q3uCzuJaOzD0T1Kv61k+0pGVdmLbLfuBQcQMDoyL9IIvjX0mdbf4smtXootSj7GR
jF3q69XooYQK/HLrgcYkAggOcHiZrjoJzpn8HWRri3En2lTjSGg9PCBcj9Qv9u0v
0FE5cVscqFuTXQtWr1N3pT5BUcPRgdy4asLoIjQcDXcdolqYFI/pUFo+hqbJkJqY
lt65iWsyh/YnzCmjShV0Be2dZSAof+2Gw7JNHdtQ6myE8VugElDzeCFmZecc07Zc
YussoDdF1uFJ2iDemv19W+5zh6zVOP5Y06KfoQt9nmsad1nqIhTIqlpe7QUpFkvo
n/t0QdEwdPUDfPlS840RBhn8pItr+sBC6k0MzpcBfYd8OyOU0hjnOeuh7zaKWOwz
3umMK0p/17pCQUPSbZdp+NchfSLsXTOn4/NdxS5hZkrcDVIcPxS9/HeUyalNypxp
h16WPOe5Q9JsPS7kJF9CL9hFFANgXjWssZ3R9lO0r1u4Ru7cBsI=
=bv9Z
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 7 Sep 2022 15:56:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 07 11:56:48 2022
Received: from localhost ([127.0.0.1]:55895 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVxQ0-0003oH-4E
	for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 11:56:48 -0400
Received: from knopi.disroot.org ([178.21.23.139]:43034)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1oVxPx-0003o7-MO
 for 57607 <at> debbugs.gnu.org; Wed, 07 Sep 2022 11:56:46 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 63A784005B;
 Wed,  7 Sep 2022 17:56:44 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id k5SSFRFXz3JH; Wed,  7 Sep 2022 17:56:43 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1662566197; bh=+xRujyyEGkfFov/td88VGPFZNVDHQktxOxGzFXiC3Vs=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=fv0DWvXvI9J12tNQt/PMS3E2vTxy5rIHQZ9L7FN+Cd5ihIjAw/y8Fb7OBgNtzQCxf
 MdbeR54pilz3tLDxwNbpHh6o9s4feFb4A1YYbcOcNgnOHfOzT8z0v+iAtXKT4Z8CLm
 g8D1eQA/EG7996Wn/kzLDFfCWTHTjcj52NNeq0O7HdISh7QSz27rN4TyynetHi0ck5
 KugkEaycvuUtcWYT/tgP+wos4rktEhVDQdFCF64QU6FOZq1BLeJQ5tMtN+Tu20Axjo
 XLmt9xcxGkYQ3VyBQsZMSMRO0EYiu268oPQ/L7AELS3DcFgHXV2gO+Z0TYT0TfUXa6
 0ALEpvcHaoPrA==
To: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <m2sfl3g4ql.fsf@HIDDEN> ("Gerd =?utf-8?Q?M=C3=B6llman?=
 =?utf-8?Q?n=22's?= message of "Wed, 07 Sep 2022 06:58:42 +0200")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN>
Date: Wed, 07 Sep 2022 21:39:18 +0600
Message-ID: <87fsh3jis9.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Akib Azmain Turja <akib@HIDDEN> writes:
>
>>> I guess no-one else before felt motifvated enough to implement this.  Do
>>> you feel motivated?
>>
>> A little.
>
> I've added something to etc/TODO.
>
> I guess there's not much else to do, so I'm closing this for now.

OK, but what to change?

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMYuygACgkQVTX89U2I
YWvp+A/+P8y9r5BUYoqQUyGsCWGWn7xaAZ3E7f7dgA69LRb53cOHjKpBb2tEKIeS
IBz7EYwHp3FJ/Fr0XZJ0CF6uM/nNCl4w7Ndv+ZBn1VPFL4kjg8T73CwCXNMyPZAB
bh3aY8028mj9b+vDPaejXtOjYwlw3wkQ4wKCBltBD4AbBxzE9ntVc0zcpzCOovf5
8oa9As/8/jgFqYU7b7SYK6z+I+pLQGC+g5SRl/SP37DRiKyvyoJt/m9AIIWX1H2w
4RiU9t775xjTRHXojqsJkwTNA14zvFUXT91WBemYSwVukmswGbrk9y0RWCiO5ofg
I22fzOFlyhhCE2Td1bUpMzyRwBut8Nw1vXnBG2krfiZXKdi6FC541yLKVPueOrui
cSNysFRzCRm3jU7u0/pvqo4QePmd5atDP1ht3y5lwwwF1HuhhRq2XtzBiEoSbss5
UMSLLfBuOYuvfPr+pBqn8ZosmcdZUmGfpiXglUJgmONbZIOs7qTeoxbjx4Zj59I6
QGU0aeo9WOOyJWYyZ89nfFYsROTJcyCXPL3w5PhJDZAlCIA2mnpgeHaWoStWsHm5
6Gwx+ar9HSOX0jh/0AeD++OJndeUTmiLEyEhfkojia7GBdHGMkluQEk+KhJePdKm
1cmYGmMm4IgFsBYSj0dMI7punGc5Sc9xOK08ztmOODPpsoBg+48=
=wlsK
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 7 Sep 2022 12:58:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 07 08:58:16 2022
Received: from localhost ([127.0.0.1]:53974 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVudD-0002rk-TW
	for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 08:58:16 -0400
Received: from mail-ej1-f53.google.com ([209.85.218.53]:45892)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gerd.moellmann@HIDDEN>) id 1oVudB-0002rW-Le
 for 57607 <at> debbugs.gnu.org; Wed, 07 Sep 2022 08:58:14 -0400
Received: by mail-ej1-f53.google.com with SMTP id dv25so889799ejb.12
 for <57607 <at> debbugs.gnu.org>; Wed, 07 Sep 2022 05:58:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date;
 bh=O1xC7L8lWS4DTWtbzkM23tF5F7REFDfAHYyUWnhQlBg=;
 b=p9+Dq1kVVUH3n0tb9ajdg5GNQJpmbywT8cvjIibvMcAJSP2MFvVuXw/WiZWA/YxnBk
 O3104np98elmKID4YtpAevRfpmOL6q7eEGqtbMadRCeAKMHUa+M+AULoX61xkg93feoN
 TblWnQOF8pcRK0q5QwjYJnSIEOQhDPCL8RctYL3G9NdrEjjJ56HhuPs8exG3f1rEY6vu
 J8mEADjPNUS81gL/GY4dZB5bwBeCS+EN1MU+rT151hFTmN7y4XtRSGHe7F5G+7kiVdM4
 NQspTvBGItpxbA6+pYskcTCL32Tz2MJvGmwq5RDQxe4m2nElqk8BygyquwMewY/XUl0v
 eO9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date;
 bh=O1xC7L8lWS4DTWtbzkM23tF5F7REFDfAHYyUWnhQlBg=;
 b=DRC/uhhNg9Fx5rd3NpyPulVXqtlMTJQo7391nWG9r6yqIHnQV7DggHWrYAeLUmmQRS
 lS6MAJV3D7Jzqy868sfnb1V4wIzKt2c0LbXzFr88Kk/q/Gf2l7M0liFzqigP8KvAYI0P
 tWn6UPhHCcfeokEZrUFyfldeTiIj4mx2aWN9d8EML3GIts0ZC04haEaeb+ZqgJ9KR/QI
 L6L0rOr0HWf/RKcP6H8Jdc23TokAJpZyoeFYeYUaJhBGJAsAOINaMGmrRSylMTSZdhPF
 cCvK+PU61jAj9kOYrq3SZEXbUwsq2MbOJpmfe/EczZkDZLmytARkNjviU7/8qEbsDio1
 h0zw==
X-Gm-Message-State: ACgBeo0daweMveOCR7k118CkHrogucHmwC87Tldbwyc50adYOdZnOztG
 xDCKxMwzz61QIvpcz41ciGBuzpZExnW+jw==
X-Google-Smtp-Source: AA6agR7GaUdIgK1Ta8pYAz9bsRmi/TFYwONqZbKOJYtzEUG5NIren4lNm6vV34M8D6FJyNIfZ3varw==
X-Received: by 2002:a17:906:c150:b0:751:2181:87a6 with SMTP id
 dp16-20020a170906c15000b00751218187a6mr2143202ejc.692.1662555487447; 
 Wed, 07 Sep 2022 05:58:07 -0700 (PDT)
Received: from Mini.fritz.box (pd9e3684f.dip0.t-ipconnect.de. [217.227.104.79])
 by smtp.gmail.com with ESMTPSA id
 u17-20020a1709061db100b0073d53f4e053sm8339760ejh.104.2022.09.07.05.58.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 07 Sep 2022 05:58:06 -0700 (PDT)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Akib Azmain Turja <akib@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <87edwnl5co.fsf@HIDDEN> (Akib Azmain Turja's message of
 "Wed, 07 Sep 2022 18:46:31 +0600")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN> <87edwnl5co.fsf@HIDDEN>
Date: Wed, 07 Sep 2022 14:58:06 +0200
Message-ID: <m28rmvfijl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Akib Azmain Turja <akib@HIDDEN> writes:

> OK, but what to change in Emacs???

I guess I'm missing something.  What do you mean?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 7 Sep 2022 12:52:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 07 08:52:14 2022
Received: from localhost ([127.0.0.1]:53944 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVuXO-0002gp-JW
	for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 08:52:14 -0400
Received: from knopi.disroot.org ([178.21.23.139]:49196)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1oVuXM-0002gf-GI
 for 57607 <at> debbugs.gnu.org; Wed, 07 Sep 2022 08:52:13 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 767E540085;
 Wed,  7 Sep 2022 14:52:10 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id VlsPN_d59MnI; Wed,  7 Sep 2022 14:52:09 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1662555129; bh=YvwXOZh+I1SL5Pyx7qnF/Du7qrQSx5ZJ9zaxrg/IIUI=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=VpKoAA76HnD1HqbF29YztmVAC/ppnFrWzGu7pCDGcRn7m+OKxs/xRYRbo1eTHsQ2u
 a/Jc98u4xFATlI9ExbpEn6Tz9bDxndwev9+dtpXf4xZtWVK1PS266UmUi1WMww2zax
 yGDzb7XptiPqeibQEcHrIP38dDUStWOljWUll5elQ0P/Ei36hr5vDRd4xZoyXHtc8R
 CoWiZ1NfWtiR8Se+6R9WDgfb7hsXZ6a3KXmsUviPx/OEKZXBpJmmhJ+lEGMHL+9FKX
 iaIEm0CPQWQ73KrgphB0Db/zQm+YeydjfyBBxqq2C66v05+YESBYy8AvUzc+5kal8M
 OEh+ibyO9vR1w==
To: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <m2sfl3g4ql.fsf@HIDDEN> ("Gerd =?utf-8?Q?M=C3=B6llman?=
 =?utf-8?Q?n=22's?= message of "Wed, 07 Sep 2022 06:58:42 +0200")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
 <m2sfl3g4ql.fsf@HIDDEN>
Date: Wed, 07 Sep 2022 18:46:31 +0600
Message-ID: <87edwnl5co.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Akib Azmain Turja <akib@HIDDEN> writes:
>
>>> I guess no-one else before felt motifvated enough to implement this.  Do
>>> you feel motivated?
>>
>> A little.
>
> I've added something to etc/TODO.
>
> I guess there's not much else to do, so I'm closing this for now.
>
>
>

OK, but what to change in Emacs???

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMYkqcACgkQVTX89U2I
YWszVw/+I/+kTSojJYdBzcARWp3PiGaMYpicv6OVe3YpAylUZNOqTu7ISWAOhd2+
jwwmcoRT8+yikkwh4FzzHJXnu1h2BWa/r5zDMkwohYLnIsA63El3Got3O5QB76d2
+njDdSRosnX/qBnVXRA9r/Fh4bfAR711A6bn0Z0fh+LXAyfoOhJR/jab8Qrp+Pf5
Sa+vb9BrTRo+oBVf7nermqEmjT8zgK30SZtHdag26ME742otMI/HtTEIeGqnQ4PQ
qlMe/L8r4jltjbIjd9tnlX2yIylfPlIWZoEYfq25TcGuvbTVI07K2kqFnWmlpvRB
raLBkgxBuqrw6GZTWqHYYSgZdmXw9TFBq0LiGyFwtUsSuWen945uur0yvkFTdjqs
f3IWdsqGmPADPiHcZcqXTxJm9lTTnW3Lk4EtzAmKq8Q+6TZz033DHc/3I9ux55JW
IQf8wv+ymTqrGqAAh/CsF5H8N0J5UC+8LHCIen4KxEkWrXGcpq5S5ieBWQKIOzxV
mYmsxwYPPE3H1BYF96B4oE2LkH7Spe2bVaDETcwbIMN+F6CxXvUWlisAjRvyao/U
mImcBG29KRlYFPUZUnifcEsvt4VdztLDsDESrQzYzNSAOUrZrxiSbYrbJn7qb9uc
g4E52Lm5hNlfT6oyjr259UIuFHwSiFybRCIzdztyw0MBUhneGBY=
=PPqG
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.
bug marked as fixed in version 29.1, send any further explanations to 57607 <at> debbugs.gnu.org and Akib Azmain Turja <akib@HIDDEN> Request was from Gerd Möllmann <gerd.moellmann@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 7 Sep 2022 04:58:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 07 00:58:54 2022
Received: from localhost ([127.0.0.1]:53161 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVn9K-0002cl-3q
	for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 00:58:54 -0400
Received: from mail-ed1-f45.google.com ([209.85.208.45]:46882)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gerd.moellmann@HIDDEN>) id 1oVn9G-0002cW-Mw
 for 57607 <at> debbugs.gnu.org; Wed, 07 Sep 2022 00:58:53 -0400
Received: by mail-ed1-f45.google.com with SMTP id s11so17936445edd.13
 for <57607 <at> debbugs.gnu.org>; Tue, 06 Sep 2022 21:58:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date;
 bh=GHYOoIsONOnsuD2xoYInCu35/OmKs76NSPBElhqzWao=;
 b=e/fQ93iowZLiVqXgyIJCWZAAvZam49+Zv6GlB50Z8X+z/bfVwRLJsq+cGfxaSwQ+RY
 vAPvXiccIRBM3ePNvm0t+q2hYnw/7h/hzbknYblXZVzpbGW+i/773MEN+sHbDFVjKWPU
 H86YSO7T6WyMntXzodfLV9pjIrvdupnB2GL4h3xMxwoxN4T+eZgBuxHydihGIGD8ROgR
 lPdBFv309/bQO8FajFYzK/wnpkrA/V3gy/oa6APVf5IZ9GR2VyaK3gpJkl8winZx4SKz
 pyUBnY+IpkCXaQ9XdPxDeR1RBEcdzy7cZcBKwFWbwh7Fh40RZgnL1ll9stO04zjGq4sd
 Kk1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date;
 bh=GHYOoIsONOnsuD2xoYInCu35/OmKs76NSPBElhqzWao=;
 b=i/ElWJVIQq0IB01VvQ1FSZbRZk8iDGD2jO+/ckNcn8EFRvj0UWlru15txoT5tOvOF7
 M3xCDpcb/VO2FJG77NnyTg7cokVDM1WGnTHG2DZueHwI32vySL0iHMt+7oEtPhA7qBVh
 acSrVIG3+hr780hZBrXDUWfarxqimgplevInvRpxBTtz75KEeFi38YWFjlwvpOdOc+wq
 jc0br5Hssm5pwtgznwdNNxPXT9aVDJt/1IrX9HNRSsq85DGaPQ7nFlWExgMcCdjb4u7h
 EYy61dPl7XoJm7y05FOq2jVV21/9XnTZvNjZa5WYHluP6gAH1tdazNS8fhd4X1plvMix
 F+/A==
X-Gm-Message-State: ACgBeo0BO3v4UZW+jbgckdEX9MSUdoXF6Z4tEAFT+yI6dlxLp3iDtm5x
 ySrfbqm5SfO+9dSOAJCE+VVXeTg/2mA=
X-Google-Smtp-Source: AA6agR6OUlvC4sVvb8J8SjBOarhwXBloHORxHR1cVb2RpMWoh1ZEi0J3vbYQn+/yYGZAL+Rlu5GaLA==
X-Received: by 2002:a05:6402:280f:b0:44e:ee5c:da6b with SMTP id
 h15-20020a056402280f00b0044eee5cda6bmr1577453ede.256.1662526724220; 
 Tue, 06 Sep 2022 21:58:44 -0700 (PDT)
Received: from Mini.fritz.box (pd9e3684f.dip0.t-ipconnect.de. [217.227.104.79])
 by smtp.gmail.com with ESMTPSA id
 d6-20020a170906304600b0073d8ad7feeasm7568497ejd.213.2022.09.06.21.58.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Sep 2022 21:58:43 -0700 (PDT)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Akib Azmain Turja <akib@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <875yi0v8r6.fsf@HIDDEN> (Akib Azmain Turja's message of
 "Tue, 06 Sep 2022 21:10:37 +0600")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN> <875yi0v8r6.fsf@HIDDEN>
Date: Wed, 07 Sep 2022 06:58:42 +0200
Message-ID: <m2sfl3g4ql.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Akib Azmain Turja <akib@HIDDEN> writes:

>> I guess no-one else before felt motifvated enough to implement this.  Do
>> you feel motivated?
>
> A little.

I've added something to etc/TODO.

I guess there's not much else to do, so I'm closing this for now.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 6 Sep 2022 15:20:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 06 11:20:00 2022
Received: from localhost ([127.0.0.1]:52339 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVaMq-0006LH-IH
	for submit <at> debbugs.gnu.org; Tue, 06 Sep 2022 11:20:00 -0400
Received: from knopi.disroot.org ([178.21.23.139]:49214)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1oVaMn-0006L7-UW
 for 57607 <at> debbugs.gnu.org; Tue, 06 Sep 2022 11:19:58 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id CF4584A01F;
 Tue,  6 Sep 2022 17:19:55 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with UTF8SMTP id ClqXgLEu4lC2; Tue,  6 Sep 2022 17:19:54 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1662477190; bh=cu4e7BVLqpa5arX6DPlsB/m7buT39bW42CLBiWrgq90=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=VsPSKR365L86wj1yErGeX2fmcWS+KCNi0MyS8Skg+Y4YpZMicYKnB6SlMp3iK6ecw
 d3bQbUNDkHrvACORx+2eGsCaVVQPNVIwczBX0LnHcbTFHS2edERHz+qVRJ0swoXfB+
 zxp5VKS9FEGl+UeUsRtOHSEmcpf/pB6fLw2U74k69Z97kBalccR6M3DVfGnXRW6rQM
 MnOVdwnT+/AAd5EO1kn1SYm6V+NdUThCrPP3IxfFJKD+kwCVGW0Jc1Quf28WX81W6c
 gYUiDSjZextPCBcmc/twcdJMiLLH1lTHe3ODoZJ/yH6PY8jmjM3EPdO3uMP4Z2GD6H
 vAlCOfkuHxiog==
To: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <m2v8q0g1ak.fsf@HIDDEN> ("Gerd =?utf-8?Q?M=C3=B6llman?=
 =?utf-8?Q?n=22's?= message of "Tue, 06 Sep 2022 14:00:51 +0200")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
 <m2v8q0g1ak.fsf@HIDDEN>
Date: Tue, 06 Sep 2022 21:10:37 +0600
Message-ID: <875yi0v8r6.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Akib Azmain Turja <akib@HIDDEN> writes:
>
>> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>>
>>> Emacs already writes to the bottom-right corner in case neither "am" nor
>>> "xn" are defined for the terminal in question.  vt100 and xterm, for
>>> instance, have "am" defined here, so Emacs doesn't write to the
>>> bottom-right corner.
>>
>> I repeat: vt100 and xterm-like terminal having any of 'ich', 'ich1',
>> 'il' and 'il1' or both 'smir' and 'rmir' can write to the last character
>> cell reliably without scrolling.
>>
>> Here is what Emacs can do IMHO:
>>
>
> I know that, I can edit text :-).
>
> I guess no-one else before felt motifvated enough to implement this.  Do
> you feel motivated?

A little.

> I could show you where to look, if you like.

It's good to know, in case I (or someone else) try to do this.

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMXYu0ACgkQVTX89U2I
YWuK2hAAoZUBxCOWhHjKzb6qJv6stB6yLC7g2nyeuCN2mngIHs15rOR7XUgdgu3w
tVDwvzF66TkDRKRVtaFBMIRyEIXakCeTE7HsIIl1R9qG90N5jAqichLs1i6Za2P5
jVBpI40GRBwnPA+ZPRmc0gYgU+JCnoYMCRS/bG/OLOwneO0+IEhYl8yRbQnfqORP
cVRAr/zAQbsa7/64+S+O1KP1XgGHKhJCC7y/zyR/dvuXHbI69QC96PIDLvkQiwnt
3mvj2rnMyPPf5DAvhtEh0Z/uMFcNOgh3aXF9aH3d8Lighm9ERbtQm4S1gEIpR39+
ysHioPkFGKLQq497dnLVLbGWWixKmKOuHFzRiSkToU/22mdkz/L4kgy7pcho3saj
v3KAKAmfugb+MSWXZPcHxV7OeD6bYU/TsHgz+AtvAyL87/cunr4dU2+hzD08Nmwm
YBjsplQhiT6fJhdR72aBQZ6STxKu+PSj26MMyobz2QggF4g1gAzgBD1g5sJBIxdy
BVRqq+KDwu1KC5Cp+MX/2e65awsv984qz5+ZgEe4I2nRPAmsf0r56OPKF6o414sV
0eSGASG5PMHgI4/RUESlJUhp4gO6c4RQFC8Xjd0riM7snga+e8DMkO+3Ttys+DNl
aW4bKNrblfF6CzUGnbH0ktCmVt4Pceu6ZYrWxMLpsh0eK3dERus=
=iSxS
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 6 Sep 2022 12:01:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 06 08:01:02 2022
Received: from localhost ([127.0.0.1]:49963 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVXGI-00064c-4S
	for submit <at> debbugs.gnu.org; Tue, 06 Sep 2022 08:01:02 -0400
Received: from mail-ej1-f49.google.com ([209.85.218.49]:46018)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gerd.moellmann@HIDDEN>) id 1oVXGF-000640-CR
 for 57607 <at> debbugs.gnu.org; Tue, 06 Sep 2022 08:01:00 -0400
Received: by mail-ej1-f49.google.com with SMTP id lx1so22622293ejb.12
 for <57607 <at> debbugs.gnu.org>; Tue, 06 Sep 2022 05:00:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date;
 bh=wq4crxzNghSOYmlUAOyo2sR5u2pdEk0myabKsxOrCog=;
 b=BtaYs/Pe/PHPdZjeRP1mH2CL92w3sZFJAtUtCsIJNtQ9zmovPjrxxAv2sTNsavmmL+
 MC9IrA0UKlDa+mpYSLF05uMk4K8EhPKVhGn4LO/NwZUAavbfxlm9ZsHcM+Kwao1zH6UX
 +4wOXNiXV9iHEtznY9FacUjzacURn0ZzfLSqPAqVz5fpczYOXQQX1z6EktLBTG/q659C
 RXnQgK9KjHv1Fwi2QjW3jb/giRqtTRZdwdOf2vjx68WyExf7liZm6zmi7cboKe4qGdH4
 0Yb7JR2WxAGP0Xs5KTQabjCevIR5Lyhb1bm3xZMjVr21qagcL+OMx7ZLUOl/UPGkvuS1
 o+Fg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date;
 bh=wq4crxzNghSOYmlUAOyo2sR5u2pdEk0myabKsxOrCog=;
 b=EUZhhWSXzPDajybMQhygBo/8tdgqkSLLEOtYc2lWDJxqVoSJLZa1y8QA10ty+Z34FO
 igseqWIzipAkusTueAGR/ZkKIIxZRGI2qhJMRIoULH/xXtHglN+9sYAWdXIJCMn3dnm6
 ISDlBB7Mj5Vk1iODlrdU9O6FXNsINsp51aQJdpQQmZtDMDsqIADd0SkuyWaLJeM7Mjty
 MEQ/vr5d5VB+b/AOeJGvO7cfWp29lFIsmWwEoanWGJhcyneqiJiiq/mjoUGRPkSO+7mA
 mU32O81l5dnBwHEQw7pOiERq0vJiInkrMOlef2KllFMe+/gJ/vhtZGZggYnvThvNqOWz
 LzXA==
X-Gm-Message-State: ACgBeo1NPh1rZdK9J0556zJfvz33+ByOfM2+VM1yYW6QscnNLV+vXyQ6
 pgbQUL0IX6pY4q3O2JiEPJQn0ztJMWU=
X-Google-Smtp-Source: AA6agR7Ru+EaVeqB6BviYcbVxHEtFKqypsrhmL3ROQCS7iTA3DJvBdAg2BfvfuqpZVT9dtr5zNZRLg==
X-Received: by 2002:a17:907:7d91:b0:731:7ecb:1e5b with SMTP id
 oz17-20020a1709077d9100b007317ecb1e5bmr39107727ejc.78.1662465652936; 
 Tue, 06 Sep 2022 05:00:52 -0700 (PDT)
Received: from Mini.fritz.box (pd9e364b5.dip0.t-ipconnect.de.
 [217.227.100.181]) by smtp.gmail.com with ESMTPSA id
 u2-20020a056402064200b00447f434e4d7sm8236421edx.20.2022.09.06.05.00.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Sep 2022 05:00:52 -0700 (PDT)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Akib Azmain Turja <akib@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <87ilm04xzl.fsf@HIDDEN> (Akib Azmain Turja's message of
 "Tue, 06 Sep 2022 16:07:42 +0600")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN> <87ilm04xzl.fsf@HIDDEN>
Date: Tue, 06 Sep 2022 14:00:51 +0200
Message-ID: <m2v8q0g1ak.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Akib Azmain Turja <akib@HIDDEN> writes:

> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>
>> Emacs already writes to the bottom-right corner in case neither "am" nor
>> "xn" are defined for the terminal in question.  vt100 and xterm, for
>> instance, have "am" defined here, so Emacs doesn't write to the
>> bottom-right corner.
>
> I repeat: vt100 and xterm-like terminal having any of 'ich', 'ich1',
> 'il' and 'il1' or both 'smir' and 'rmir' can write to the last character
> cell reliably without scrolling.
>
> Here is what Emacs can do IMHO:
>

I know that, I can edit text :-).

I guess no-one else before felt motifvated enough to implement this.  Do
you feel motivated?  I could show you where to look, if you like.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 6 Sep 2022 11:07:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 06 07:07:46 2022
Received: from localhost ([127.0.0.1]:49785 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVWQk-0006EO-2L
	for submit <at> debbugs.gnu.org; Tue, 06 Sep 2022 07:07:46 -0400
Received: from knopi.disroot.org ([178.21.23.139]:33730)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1oVWQh-0006ED-OO
 for 57607 <at> debbugs.gnu.org; Tue, 06 Sep 2022 07:07:44 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 0650D49FCC;
 Tue,  6 Sep 2022 13:07:42 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with UTF8SMTP id gS_Vl-rw98y4; Tue,  6 Sep 2022 13:07:40 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1662462404; bh=rBniXk8dISoAnnMTbSXlPzIqOEBUO5KZafyDIZloHTk=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=EoDci7WXrzE8yGr2pfjSqU9FjuCEzT8Z7gnF+EQNwAwEkMHg+v4r+MwSgJ+kB1oWP
 21AMdY9YxGh//sjvZiHGgrijSMzIPPDavnxp9AZIG1p2iV1Qu0ycPjHYGpf4vo8NWK
 Kru1QZi7V/29Rk0lbaIYzSpfiFyGJTyqyoDSzzsETjkuWgxG3gp53HVzqvt1Mn1iha
 +Ub/qbCF75cZ1qqUiupsroPVofE38eCQJGzUFN22p1LDSpNg3jUGePHLavl05SdqP2
 rmwWBiO3V8WtPqirgvg1kBcWtwW8NzOPndRq6f4d+kiGqIgOgCNwC7zeQc3104IELj
 RMI6e/+HDDIwQ==
To: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <m2zgfdexpq.fsf@HIDDEN> ("Gerd =?utf-8?Q?M=C3=B6llman?=
 =?utf-8?Q?n=22's?= message of "Tue, 06 Sep 2022 10:03:29 +0200")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
 <m2zgfdexpq.fsf@HIDDEN>
Date: Tue, 06 Sep 2022 16:07:42 +0600
Message-ID: <87ilm04xzl.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Akib Azmain Turja <akib@HIDDEN> writes:
>
>> Forwarding to bug-gnu-emacs list.
>>
>> Akib Azmain Turja <akib@HIDDEN> writes:
>>
>>> Emacs never writes to the bottom-right corner of a terminal, because the
>>> terminal might open a new line at bottom of screen.  But terminals
>>> having any of 'ich', 'ich1' and 'smir' capabilities can write to the
>>> bottom-right corner of the terminal.  Almost all terminals have at least
>>> one of the aforementioned capabilities.  Why doesn't Emacs make use of
>>> that?
>
> I don't know.  And I don't know if that would work, it would require
> investigation.

There must be a way reliably way to do so, because ncurses can write to
the last character cell on terminal on linux console and xterm-like
terminal emulators.

>
> Emacs already writes to the bottom-right corner in case neither "am" nor
> "xn" are defined for the terminal in question.  vt100 and xterm, for
> instance, have "am" defined here, so Emacs doesn't write to the
> bottom-right corner.

I repeat: vt100 and xterm-like terminal having any of 'ich', 'ich1',
'il' and 'il1' or both 'smir' and 'rmir' can write to the last character
cell reliably without scrolling.

Here is what Emacs can do IMHO:

Glyph matrix (or whatever):

+------------------------+
|foo                     |
|bar                     |
|baz                     |
| --- *scratch* ---------|
|A very looooong message.|
+------------------------+

* Case: Any of 'ich', 'ich1', or both 'smir' and 'rmir' defined.

  *Note*: Won't work on displays with only a single column.

  Write to all character cells except the last two:

  +------------------------+
  |foo                     |
  |bar                     |
  |baz                     |
  | --- *scratch* ---------|
  |A very looooong messag  | <-- cursor
  +------------------------+
                         ^
                         |
                       cursor

  * Case: 'ich1' defined.

    Write the glyph to be placed on the last character cell.

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong messag. | <-- cursor
    +------------------------+
                            ^
                            |
                          cursor

    Move to the character cell on the left side (cub1):

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong messag. | <-- cursor
    +------------------------+
                           ^
                           |
                         cursor

    Invoke (or write or whatever) 'ich1':

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong messag .| <-- cursor
    +------------------------+
                           ^
                           |
                         cursor

    Write the glyph to be placed on the character cell before the last
    character cell:

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong message.| <-- cursor
    +------------------------+
                            ^
                            |
                          cursor

  * Case: 'ich' defined.

  Same as the 'ich1' case, but invoke 'ich' with parameter '1' instead
  of 'ich1'.

  * Case: 'smir' and 'rmir' defined.

    Write the glyph to be placed on the last character cell.

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong messag. | <-- cursor
    +------------------------+
                            ^
                            |
                          cursor

    Move to the character cell on the left side (cub1):

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong messag. | <-- cursor
    +------------------------+
                           ^
                           |
                         cursor

    Invoke 'smir'.

    Write the glyph to be placed on the character cell before the last
    character cell:

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong message.| <-- cursor
    +------------------------+
                            ^
                            |
                          cursor

    Invoke 'rmir'.

* Case: 'il' or 'il1' defined.

  *Note*: Won't work on displays with only a single line.

  Write to all lines except the last two:

  +------------------------+
  |foo                     |
  |bar                     |
  |baz                     |
  |                        | <-- cursor
  |                        |
  +------------------------+
   ^
   |
  cursor

  Write the glyphs to be placed on the last line.

  +------------------------+
  |foo                     |
  |bar                     |
  |baz                     |
  |A very looooong message.|
  |                        | <-- cursor
  +------------------------+
   ^
   |
  cursor

  Move to the character cell above (cuu1):

  +------------------------+
  |foo                     |
  |bar                     |
  |baz                     |
  |A very looooong message.| <-- cursor
  |                        |
  +------------------------+
   ^
   |
  cursor

  * Case: 'il1' defined.

    Invoke 'il1'.

  * Case: 'il' defined.

    Invoke 'il1' with parameter '1'.

  +------------------------+
  |foo                     |
  |bar                     |
  |baz                     |
  |                        | <-- cursor
  |A very looooong message.|
  +------------------------+
   ^
   |
  cursor

  Insert the glyphs to be placed on the line before the last line:

  +------------------------+
  |foo                     |
  |bar                     |
  |baz                     |
  | --- *scratch* ---------|
  |A very looooong message.| <-- cursor
  +------------------------+
   ^
   |
  cursor

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMXG+8ACgkQVTX89U2I
YWsQnQ//aGvTgeSjKzKYKTWgjQfCJSFLvs/J1jqNMLom/M5fBf6+Y5YZNfIIPu3C
6oAJBbFKcfagXap/oe6I+gt2yDb9GYr0Q+n38pMCjFfK7HSi4ND9y5FTdch7ymR3
ApKhntsohYWoRbWghxQqGmKKlV1cdBhMl9+sZvH8QzDXl7COkzApzId7MiuF0/GR
aeTyIbt/cuN6893y3LY+hpWllO0F8uGj0SKpAyjENIPTmNV1RRGFec+vHDQoSIua
8GHvkbWCACU5JphY/fW/hU3UkuBZ5DdZB/YriZENWAW+vyeVEdMrrCeu47pDHml8
wE1Jf/zO90OrkZS0RVHjQEOGw5sig3zRv6NdK24BhxXNIiR+GghgtT9ZL11Q84PN
RrlC3DUxWMIV7I36sH138DHbL+fjz4/GWnWEBIdDNzeT/EGiu3Ne7ojAJgNGL+25
NlYcA5G5awB5XbhBi2xH5GhiKdDco7lDPsnScvspgWfD46qXcdGZcms6atonS5Hs
A1QY/uRkjw18zH+bj1DGbQn9GV+XHkcXGAlV+6kV5JhazbfOGi7vKXHi8XCAxCWo
IWT35+ej5u1d/YDK3bAGMOiCjKd4vtqS8uYjHtWtheIUJ0/KPcHiGTQWP1L1JbtG
6NHf4rG4POVZ6Jzz2DxNZzQIrms03gKnuue7OWj7VM/ry2trcik=
=ZJ44
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at 57607 <at> debbugs.gnu.org:


Received: (at 57607) by debbugs.gnu.org; 6 Sep 2022 08:03:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 06 04:03:39 2022
Received: from localhost ([127.0.0.1]:49483 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVTYZ-0004st-8G
	for submit <at> debbugs.gnu.org; Tue, 06 Sep 2022 04:03:39 -0400
Received: from mail-ej1-f45.google.com ([209.85.218.45]:42927)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gerd.moellmann@HIDDEN>) id 1oVTYX-0004sh-Iw
 for 57607 <at> debbugs.gnu.org; Tue, 06 Sep 2022 04:03:38 -0400
Received: by mail-ej1-f45.google.com with SMTP id dc5so1503718ejb.9
 for <57607 <at> debbugs.gnu.org>; Tue, 06 Sep 2022 01:03:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date;
 bh=dMY9VCl32DsZs1nX9hNt1lAVQ2AmsmA/sNsLE79CGV8=;
 b=omSdy6rZsY8keftvLUpn0Sl24AQuwLgo4tZTw+CTX2yxYHUzGyz8purBhJKbVm3CWP
 Xs/HdMAeqvSutl9ui7QZFaWInMymuR+hjT4VEZE9qttnwDG/wFdBo67A5NLqjk9vBaMM
 E8/se0zDmdKjGcZb0amo/hTxB1S/zVw6ab0TEykEX86XVffyRjFpqtK9qkzf0mG1qWlW
 J4hx1pb+DjDMkCIWHiwWZ+vNMe44qAdnwwObD3PeSwZ50flR/uzRG8iVc6r5NRjEpdS7
 svuf/WkAbmqk/2/IC32v7VVyEy79L/ljSQ+dQyYghgbWpQnrogkgVZC+Tl5rlUX5WnsR
 pzfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date;
 bh=dMY9VCl32DsZs1nX9hNt1lAVQ2AmsmA/sNsLE79CGV8=;
 b=I1Fd7Z+KQmc6V2aCmhnZc9pOduzOV/xuP1RMlgGIyPgyL6qEyMQeOR4LcR7nj9TdbZ
 GXZ5xe48W/peuvP7KPoEukftHgdS/ZnLRJhbfNe4PSQTLnp+kdliL1Ytm84mDpNtoo7G
 FRDqCZ5iYJl5Rx+KFeXmuqPqTeqX73F5sJM+DNrBYR7eDKeAZrYfTYAiCTr89hFf2qSD
 sTIFcHi/kWSYW3MTTgvbPb/aATaz0c1TU2ZBCEP9BbQb30NRaSXn6gzxu/4ZFTdqAybK
 tIreVwyfIJkSmg+CGeJ4BBsLQ9Iua/V1MjfBaR8+cwiPvx9h8s/J70pJZpsDBUAHlbmO
 u5eQ==
X-Gm-Message-State: ACgBeo0eVBHdTZnna/Jf7dUiKM7Gdq/EN5lphfhLyrzOV43hefelzNxi
 NON33ne78F73kdqi+jBpXe6I+59F/nM=
X-Google-Smtp-Source: AA6agR5zlec8DJYNVoWpI6BpZ3dOJQVSCVlDyXnr8jEPe0CRuD4avohbR09tlN7xtMisiG7A4oNYQQ==
X-Received: by 2002:a17:907:7f8b:b0:73d:6f4f:30f7 with SMTP id
 qk11-20020a1709077f8b00b0073d6f4f30f7mr37944573ejc.323.1662451411258; 
 Tue, 06 Sep 2022 01:03:31 -0700 (PDT)
Received: from Mini.fritz.box (pd9e364b5.dip0.t-ipconnect.de.
 [217.227.100.181]) by smtp.gmail.com with ESMTPSA id
 ay2-20020a056402202200b0044841a78c70sm7868908edb.93.2022.09.06.01.03.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Sep 2022 01:03:30 -0700 (PDT)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Akib Azmain Turja <akib@HIDDEN>
Subject: Re: bug#57607: Feature request: Use the character cell on
 bottom-right corner of a terminal
In-Reply-To: <87o7vt3s58.fsf@HIDDEN> (Akib Azmain Turja's message of
 "Tue, 06 Sep 2022 12:59:15 +0600")
References: <87wnakl5md.fsf@HIDDEN> <87o7vt3s58.fsf@HIDDEN>
Date: Tue, 06 Sep 2022 10:03:29 +0200
Message-ID: <m2zgfdexpq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57607
Cc: 57607 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Akib Azmain Turja <akib@HIDDEN> writes:

> Forwarding to bug-gnu-emacs list.
>
> Akib Azmain Turja <akib@HIDDEN> writes:
>
>> Emacs never writes to the bottom-right corner of a terminal, because the
>> terminal might open a new line at bottom of screen.  But terminals
>> having any of 'ich', 'ich1' and 'smir' capabilities can write to the
>> bottom-right corner of the terminal.  Almost all terminals have at least
>> one of the aforementioned capabilities.  Why doesn't Emacs make use of
>> that?

I don't know.  And I don't know if that would work, it would require
investigation.

Emacs already writes to the bottom-right corner in case neither "am" nor
"xn" are defined for the terminal in question.  vt100 and xterm, for
instance, have "am" defined here, so Emacs doesn't write to the
bottom-right corner.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Sep 2022 07:09:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 06 03:09:28 2022
Received: from localhost ([127.0.0.1]:49414 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVSi8-0003Nz-Dn
	for submit <at> debbugs.gnu.org; Tue, 06 Sep 2022 03:09:28 -0400
Received: from lists.gnu.org ([209.51.188.17]:45396)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akib@HIDDEN>) id 1oVSi6-0003Nr-Eg
 for submit <at> debbugs.gnu.org; Tue, 06 Sep 2022 03:09:26 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:39108)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <akib@HIDDEN>) id 1oVSi2-0001Bs-Jv
 for bug-gnu-emacs@HIDDEN; Tue, 06 Sep 2022 03:09:23 -0400
Received: from knopi.disroot.org ([178.21.23.139]:54224)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <akib@HIDDEN>) id 1oVShw-0007Ez-Uv
 for bug-gnu-emacs@HIDDEN; Tue, 06 Sep 2022 03:09:20 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 20A7240053
 for <bug-gnu-emacs@HIDDEN>; Tue,  6 Sep 2022 09:09:04 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from knopi.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with UTF8SMTP id SAkFIsThZ4Rh for <bug-gnu-emacs@HIDDEN>;
 Tue,  6 Sep 2022 09:09:03 +0200 (CEST)
From: Akib Azmain Turja <akib@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1662448142; bh=9wpUlMAU7pqk56rXYw0SUbns8Js2TX/P42YU5uPfFog=;
 h=From:To:Subject:In-Reply-To:References:Date;
 b=cM0O0cdNqp/eUuytlYuD5KWTGDHxRTz81N8aqmw2G3pTRC008S+6k5+d0aEZmzFb6
 +mMb10VnySxJMMyFc5Mv/dKuVdWhdniT3mgHuXqoLt485clYkwIvQPU3lJXsgy04+d
 7+3iyXOv5a+qb7z3cSvXJDdoZ+MgQH4zQmRk9mzzHECiBvc0AiKQZ3lAKvgJEnm3wu
 hp5s2MF+c5o9LeKln3Xx2CzxKK637GPAjtNfqYze5uDtCf+T9XYbAygsUZ9XLIJLDa
 Sp+Qye8R1z2K9YLe0sizxUXICebTIBI4nF0n9RbTi0aMX2sJ6x8I/f958VHmP9tREL
 2TwNkAqAw64Jg==
To: bug-gnu-emacs@HIDDEN
Subject: Feature request: Use the character cell on bottom-right corner of a
 terminal
In-Reply-To: <87wnakl5md.fsf@HIDDEN> (Akib Azmain Turja's message of
 "Sat, 03 Sep 2022 23:39:22 +0600")
References: <87wnakl5md.fsf@HIDDEN>
Date: Tue, 06 Sep 2022 12:59:15 +0600
Message-ID: <87o7vt3s58.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
Received-SPF: pass client-ip=178.21.23.139; envelope-from=akib@HIDDEN;
 helo=knopi.disroot.org
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Forwarding to bug-gnu-emacs list.

Akib Azmain Turja <akib@HIDDEN> writes:

> Emacs never writes to the bottom-right corner of a terminal, because the
> terminal might open a new line at bottom of screen.  But terminals
> having any of 'ich', 'ich1' and 'smir' capabilities can write to the
> bottom-right corner of the terminal.  Almost all terminals have at least
> one of the aforementioned capabilities.  Why doesn't Emacs make use of
> that?

=2D-=20
Akib Azmain Turja

Find me on Mastodon at @akib@HIDDEN

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMW78MACgkQVTX89U2I
YWvBchAAqoR+1DqkJ3p1O3aPdTfaAYWRf/u57qA3/S3zMngYHre/wfmlSIDMLvnQ
SwYpr/SnWoA6bqXw3nFebqmi9M7fYjZxqFQE5OyQ7yhLeWPcR4e4IJErg3rcsc0M
6aygsU2oY5QMzRS4vpk0vKltX/mXzOyx1Fvw+Vzy4r9fLF1g1ECWE58Xv42IsqHi
jY6zEYd6snSKGSQnVe3RilE/tTxmEI3KEmQyqRdXI1ZnEwXkqkr65WIEO4PFCRhX
AzjkyGnpHtVX++PgcOj1rZGxsUMePUddJTDmSOdTuQQa9UDaYUu/3ZDfJUxV2cyw
INmC1ymFvEtR1gKVrX1jDG96x50jTVNiN2m0POCQfolhyvyVSppaQ0VwG2PxILif
uuF+jy9Jzse2GdmGAxySsbAdUszZ1nlPNEX3dm5ax6h7We3vTwFkXO3FTaRWwPbU
xyBoEN4ya8NcF8k9RY/wNdeKKPs+dWQIFxhGqQN23X3sUzqQYW+xBHGP/cf10e18
pw64WlTAmjirdYAoM8RmRGLz2jX0zCxfh6A0fABYi11DFncG0uHqfbA06kHf63R0
TqxxJB2isU9ERBGgjq938jvyd5lRqbXqeTTsmTdxjXXb+40gJgyHj5+/PXVgaglz
n3hfPMAtZn5YsYGsYlfrE1R4i1YhLZ/l1OJAQHXC0sk2NGlEHnU=
=DKs3
-----END PGP SIGNATURE-----
--=-=-=--




Acknowledgement sent to Akib Azmain Turja <akib@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#57607; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 9 Mar 2025 11:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.