Re: [PATCH] emacs: fix author field width with double-width chars

Subject: Re: [PATCH] emacs: fix author field width with double-width chars

Date: Sat, 28 Jun 2025 20:49:44 +0800

To: David Bremner

Cc: notmuch@notmuchmail.org

From: 赵一开


On Sat, Jun 28, 2025 at 8:12 PM David Bremner <david@tethera.net> wrote:
>
> Yikai Zhao <yikai@z1k.dev> writes:
>
> > Some non-ascii characters is double-width (e.g. CJK characters), which
> > means that its `length' is not the same as `string-width' (display
> > width). This commit fixes the width calculation in
> > notmuch-search-insert-authors so that author field with these
> > characters can be properly aligned.
>
> Thank you for the fix. Can you also send as an attachment a small
> message (possibly artificial) that displays incorrectly with the current
> code and correctly with the fix?
>

Hi,

This can be easily reproduced if some emails have a long non-ascii
sender name. See attached for such one. (You may need to install a
Chinese font. e.g. Noto CJK font).

I also attached two images showing the result before and after the fix.
1751114082.xxx.test (application/octet-stream)after_fix.pngbefore_fix.png
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: