unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Akib Azmain Turja <akib@disroot.org>
Cc: gerd.moellmann@gmail.com, 57607@debbugs.gnu.org
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	[thread overview]
Message-ID: <83o7urvjdz.fsf@gnu.org> (raw)
In-Reply-To: <87lepver2e.fsf@disroot.org> (message from Akib Azmain Turja on Tue, 04 Oct 2022 18:00:57 +0600)

> From: Akib Azmain Turja <akib@disroot.org>
> 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





  reply	other threads:[~2022-10-04 12:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87wnakl5md.fsf@disroot.org>
2022-09-06  6:59 ` bug#57607: Feature request: Use the character cell on bottom-right corner of a terminal Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-06  8:03   ` Gerd Möllmann
2022-09-06 10:07     ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-06 12:00       ` Gerd Möllmann
2022-09-06 15:10         ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-07  4:58           ` Gerd Möllmann
2022-09-07 12:46             ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-07 12:58               ` Gerd Möllmann
2022-09-07 15:39             ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-07 17:26             ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-08  5:49               ` Gerd Möllmann
2022-09-08 11:28                 ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-08 12:35                   ` Gerd Möllmann
2022-09-08 14:47                     ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-11  9:00                       ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-11 10:08                         ` Gerd Möllmann
2022-09-11 10:39                           ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-03  8:31                   ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-03 19:41                     ` Eli Zaretskii
2022-10-04  7:22                       ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-04  8:07                         ` Eli Zaretskii
2022-10-04 12:00                           ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-04 12:54                             ` Eli Zaretskii [this message]
2022-10-07 13:10                               ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-07 19:30                                 ` Eli Zaretskii
2022-10-04 13:05                             ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83o7urvjdz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=57607@debbugs.gnu.org \
    --cc=akib@disroot.org \
    --cc=gerd.moellmann@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).