From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akib Azmain Turja via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#57607: Feature request: Use the character cell on bottom-right corner of a terminal Date: Fri, 07 Oct 2022 19:10:08 +0600 Message-ID: <87r0zj93v3.fsf@disroot.org> References: <87wnakl5md.fsf@disroot.org> <87o7vt3s58.fsf@disroot.org> <87ilm04xzl.fsf@disroot.org> <875yi0v8r6.fsf@disroot.org> <874jxjhz9l.fsf@disroot.org> <87tu5i9kbg.fsf@disroot.org> <87r0zpi9za.fsf@disroot.org> <83y1twwv7w.fsf@gnu.org> <87edvohx2s.fsf@disroot.org> <83a66cvwob.fsf@gnu.org> <87lepver2e.fsf@disroot.org> <83o7urvjdz.fsf@gnu.org> Reply-To: Akib Azmain Turja Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5502"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, 57607@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 07 16:39:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ogoVM-0001A4-Jq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Oct 2022 16:39:12 +0200 Original-Received: from localhost ([::1]:37270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogoVL-0007Ss-58 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Oct 2022 10:39:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ognGk-0001SN-Jy for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2022 09:20:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ognGk-0002dk-9d for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2022 09:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ognGj-00020C-Sv for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2022 09:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Akib Azmain Turja Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Oct 2022 13:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57607 X-GNU-PR-Package: emacs Original-Received: via spool by 57607-submit@debbugs.gnu.org id=B57607.16651487797662 (code B ref 57607); Fri, 07 Oct 2022 13:20:01 +0000 Original-Received: (at 57607) by debbugs.gnu.org; 7 Oct 2022 13:19:39 +0000 Original-Received: from localhost ([127.0.0.1]:34822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ognGN-0001zW-9x for submit@debbugs.gnu.org; Fri, 07 Oct 2022 09:19:39 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:51302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ognGL-0001zM-IC for 57607@debbugs.gnu.org; Fri, 07 Oct 2022 09:19:38 -0400 Original-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 Original-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) 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== In-Reply-To: <83o7urvjdz.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 04 Oct 2022 15:54:48 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244795 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: Akib Azmain Turja >> Cc: 57607@debbugs.gnu.org, gerd.moellmann@gmail.com >> 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@hostux.social. 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----- --=-=-=--