all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: "James P. Ascher" <jpa4q@virginia.edu>
Cc: 31588@debbugs.gnu.org
Subject: bug#31588: 26.1; format counts some Unicode characters as two
Date: Thu, 24 May 2018 20:50:45 -0400	[thread overview]
Message-ID: <87in7cfti2.fsf@gmail.com> (raw)
In-Reply-To: <m0bmd4a7va.fsf@virginia.edu> (James P. Ascher's message of "Thu,  24 May 2018 20:36:57 -0400")

[-- Attachment #1: Type: text/plain, Size: 954 bytes --]

"James P. Ascher" <jpa4q@virginia.edu> writes:

> 3: M-S-: and call (insert (format "%-2s" '➖))
>
> What I expected:
>
> xxxxx➖ xxxxxxxx
>
> What results:
>
> xxxxxx➖xxxxxxx
>
>
> In comparison, (insert (format "%-2s" 'z)) gives:
>
> xxxxxxz xxxxxx

> The same problem occurs on my setup with ❌ (CROSS MARK).
>
> However, these Unicode items characters work as I expect: ▶ (BLACK
> RIGHT-POINTING TRIANGLE), ✚ (HEAVY GREEK CROSS), ▷ (WHITE RIGHT-POINTING
> TRIANGLE), and ◼ (BLACK MEDIUM SQUARE).
>
> As far as I can tell, something is off about the styled_format and how
> it counts characters- I suspect something about counting
> multibyte characters, but it's a little beyond me.

I think it's intended, ➖ and ❌ are wide characters:

    (mapcar #'char-width '(?➖ ?❌ ?▶ ?✚ ?▷ ?◼))
    ;=> (2 2 1 1 1 1)

Although in my current font the width seems to be more like 1.8 or
something.


[-- Attachment #2: screenshot of the characters --]
[-- Type: image/png, Size: 3321 bytes --]

  reply	other threads:[~2018-05-25  0:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25  0:36 bug#31588: 26.1; format counts some Unicode characters as two James P. Ascher
2018-05-25  0:50 ` Noam Postavsky [this message]
2018-05-25  6:37   ` Eli Zaretskii
2018-06-03 16:29     ` Noam Postavsky

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=87in7cfti2.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=31588@debbugs.gnu.org \
    --cc=jpa4q@virginia.edu \
    /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.