From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#57607: Feature request: Use the character cell on bottom-right corner of a terminal Date: Tue, 04 Oct 2022 15:54:48 +0300 Message-ID: <83o7urvjdz.fsf@gnu.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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32748"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, 57607@debbugs.gnu.org To: Akib Azmain Turja Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 04 15:08:12 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 1ofhed-0008Jz-Jf for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Oct 2022 15:08:11 +0200 Original-Received: from localhost ([::1]:58494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofhec-0005o2-Cg for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Oct 2022 09:08:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofhSs-0003p2-Fw for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2022 08:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53805) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofhSs-000592-7J for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2022 08:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ofhSs-0003YX-0n for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2022 08:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Oct 2022 12:56: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.166488813113632 (code B ref 57607); Tue, 04 Oct 2022 12:56:01 +0000 Original-Received: (at 57607) by debbugs.gnu.org; 4 Oct 2022 12:55:31 +0000 Original-Received: from localhost ([127.0.0.1]:52883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofhSN-0003Xo-3s for submit@debbugs.gnu.org; Tue, 04 Oct 2022 08:55:31 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofhSK-0003Xa-Ma for 57607@debbugs.gnu.org; Tue, 04 Oct 2022 08:55:29 -0400 Original-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 ) 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==; Original-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 ) id 1ofhS5-0007yi-Lx; Tue, 04 Oct 2022 08:55:20 -0400 In-Reply-To: <87lepver2e.fsf@disroot.org> (message from Akib Azmain Turja on Tue, 04 Oct 2022 18:00:57 +0600) 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:244426 Archived-At: > From: Akib Azmain Turja > Cc: 57607@debbugs.gnu.org, gerd.moellmann@gmail.com > 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