all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: shingo.fg8@gmail.com, 48148@debbugs.gnu.org
Subject: bug#48148: 27.2; ox-ascii breaks TITLE line wrongly when 2 width char is used
Date: Sun, 02 May 2021 15:48:14 +0300	[thread overview]
Message-ID: <83tunl714h.fsf@gnu.org> (raw)
In-Reply-To: <871rap9vn3.fsf@nicolasgoaziou.fr> (message from Nicolas Goaziou on Sun, 02 May 2021 14:18:24 +0200)

> From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
> Cc: shingo.fg8@gmail.com,  48148@debbugs.gnu.org
> Date: Sun, 02 May 2021 14:18:24 +0200
> 
> My problem is that I have some string, _which is not displayed anywhere_
> yet. I need to obtain its real width along with the width of a single
> character in order to compute the length argument in `make-string'.

The width of any text on display is meaningless unless you also tell
in what window will it be displayed.  That's because some of the
factors that affect the display width depend on the window and the
buffer shown by that window.

So assuming the string you have will eventually be displayed in some
window -- and most strings in Emacs are of that kind -- you should use
that window up front.  Otherwise, the value you get from other methods
can only be an approximation, which will sometimes be close, and
sometimes quite far from the truth.




  reply	other threads:[~2021-05-02 12:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-01 23:52 bug#48148: 27.2; ox-ascii breaks TITLE line wrongly when 2 width char is used Shingo Tanaka
2021-05-02  7:03 ` Eli Zaretskii
2021-05-02  8:23   ` Nicolas Goaziou
2021-05-02  9:11     ` Eli Zaretskii
2021-05-02 11:33       ` Shingo Tanaka
2021-05-02 12:43         ` Eli Zaretskii
2021-05-02 12:18       ` Nicolas Goaziou
2021-05-02 12:48         ` Eli Zaretskii [this message]
2021-05-02 15:56           ` Nicolas Goaziou
2021-05-02 16:11             ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=83tunl714h.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=48148@debbugs.gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    --cc=shingo.fg8@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.