Don't account for character compositions in 'format' and friends
authorEli Zaretskii <eliz@gnu.org>
Sun, 30 May 2021 08:16:59 +0000 (11:16 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sun, 30 May 2021 08:16:59 +0000 (11:16 +0300)
commit23ad0f0c5adbeda9a0bd346138e2950cb5e5a136
tree8ec396ecfdd2aa190b8e98186d728762b169bbea
parent7671d470781a3e68b4e39b43281c0b1b73c5eaa9
Don't account for character compositions in 'format' and friends

'lisp_string_width' is called from 'format' and 'format-message',
which can be called both very early into Emacs initialization and in
other contexts where using the font backend is impossible or
undesirable.  So this commit changes 'lisp_string_width' to try
accounting for automatic compositions only when explicitly requested,
and only 'string-width' does that; 'format' and 'format-message'
don't.
* src/character.c (lisp_string_width): Accept an additional
argument AUTO_COMP; attempt accounting for auto-compositions only
if that argument is non-zero.  (Bug#48732)
* src/editfns.c (styled_format):
* src/character.c (Fstring_width): Callers of 'lisp_string_width'
adjusted.
src/character.c
src/character.h
src/editfns.c