Package: emacs;
Reported by: Ŝarl Bodler <sharl <at> bodler.eu>
Date: Sun, 5 Oct 2025 07:09:01 UTC
Severity: normal
Found in version 30.1
Done: Eli Zaretskii <eliz <at> gnu.org>
To reply to this bug, email your comments to 79576 AT debbugs.gnu.org.
There is no need to reopen the bug first.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
bug-gnu-emacs <at> gnu.org:bug#79576; Package emacs.
(Sun, 05 Oct 2025 07:09:02 GMT) Full text and rfc822 format available.Ŝarl Bodler <sharl <at> bodler.eu>:bug-gnu-emacs <at> gnu.org.
(Sun, 05 Oct 2025 07:09:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Ŝarl Bodler <sharl <at> bodler.eu> To: bug-gnu-emacs <at> gnu.org Subject: 30.1; string-glyph-split and ert Date: Sat, 4 Oct 2025 15:41:24 +0200
Dear maintainers,
I have encountered a possible bug when testing the function
string-glyph-split with an ERT test.
1) If I evaluate the following expression, the result is t :
(equal (string-glyph-split "AüB")
(list "A" "ü" "B"))
2) If I create a new testing function with this expression and run it
with ert, the test is failing :
(ert-deftest my-failing-test ()
(should (equal (string-glyph-split "AüB")
(list "A" "ü" "B"))))
Selector: t
Passed: 0
Failed: 1 (1 unexpected)
Skipped: 0
Total: 1/1
Started at: 2025-10-04 15:26:19+0200
Finished.
Finished at: 2025-10-04 15:26:20+0200
F
F my-failing-test
(ert-test-failed
((should (equal (string-glyph-split "AüB") (list "A" "ü" "B")))
:form (equal ("A" "u" "̈" "B") ("A" "ü" "B")) :value nil
:explanation
(proper-lists-of-different-length 4 3 ("A" "u" "̈" "B")
("A" "ü" "B") first-mismatch-at 1)))
I don't understand why string-glyph-split behave differently within the
ERT test and
I think that this is a bug.
Thank you very much,
Ŝarl Bodler
In GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.49,
cairo version 1.18.4) of 2025-07-18, modified by Debian built on sbuild
System Description: Debian GNU/Linux 13 (trixie)
Configured using:
'configure --build x86_64-linux-gnu --prefix=/usr
--sharedstatedir=/var/lib --libexecdir=/usr/libexec
--localstatedir=/var/lib --infodir=/usr/share/info
--mandir=/usr/share/man --with-libsystemd --with-pop=yes
--enable-locallisppath=/etc/emacs:/usr/local/share/emacs/30.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/30.1/site-lisp:/usr/share/emacs/site-lisp
--with-sound=alsa --without-gconf --with-mailutils --build
x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
--libexecdir=/usr/libexec --localstatedir=/var/lib
--infodir=/usr/share/info --mandir=/usr/share/man --with-libsystemd
--with-pop=yes
--enable-locallisppath=/etc/emacs:/usr/local/share/emacs/30.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/30.1/site-lisp:/usr/share/emacs/site-lisp
--with-sound=alsa --without-gconf --with-mailutils --with-cairo
--with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
'CFLAGS=-g -O2 -Werror=implicit-function-declaration
-ffile-prefix-map=/build/reproducible-path/emacs-30.1+1=.
-fstack-protector-strong
-fstack-clash-protection -Wformat -Werror=format-security
-fcf-protection -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
LDFLAGS=-Wl,-z,relro'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
Important settings:
value of $LANG: fr_FR.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: ERT-Results
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
minibuffer-regexp-mode: t
buffer-read-only: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: (only . t)
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-seq cl-macs
cl-extra ert map pp ewoc debug backtrace help-mode find-func cl-loaddefs
cl-lib subr-x term/xterm xterm byte-opt gv bytecomp byte-compile rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo gtk x-toolkit xinput2 x multi-tty move-toolbar
make-network-process native-compile emacs)
Memory information:
((conses 16 83223 14035) (symbols 48 7349 0) (strings 32 19025 1714)
(string-bytes 1 567903) (vectors 16 9588)
(vector-slots 8 109181 8681) (floats 8 35 7) (intervals 56 374 0)
(buffers 992 14))
bug-gnu-emacs <at> gnu.org:bug#79576; Package emacs.
(Sun, 05 Oct 2025 07:57:01 GMT) Full text and rfc822 format available.Message #8 received at 79576 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: Ŝarl Bodler <sharl <at> bodler.eu> Cc: 79576 <at> debbugs.gnu.org Subject: Re: bug#79576: 30.1; string-glyph-split and ert Date: Sun, 05 Oct 2025 10:56:12 +0300
> Date: Sat, 4 Oct 2025 15:41:24 +0200
> From: Ŝarl Bodler <sharl <at> bodler.eu>
>
> Dear maintainers,
>
> I have encountered a possible bug when testing the function
> string-glyph-split with an ERT test.
>
> 1) If I evaluate the following expression, the result is t :
>
> (equal (string-glyph-split "AüB")
> (list "A" "ü" "B"))
>
> 2) If I create a new testing function with this expression and run it
> with ert, the test is failing :
>
> (ert-deftest my-failing-test ()
> (should (equal (string-glyph-split "AüB")
> (list "A" "ü" "B"))))
>
> Selector: t
> Passed: 0
> Failed: 1 (1 unexpected)
> Skipped: 0
> Total: 1/1
>
> Started at: 2025-10-04 15:26:19+0200
> Finished.
> Finished at: 2025-10-04 15:26:20+0200
>
> F
>
> F my-failing-test
> (ert-test-failed
> ((should (equal (string-glyph-split "AüB") (list "A" "ü" "B")))
> :form (equal ("A" "u" "̈" "B") ("A" "ü" "B")) :value nil
> :explanation
> (proper-lists-of-different-length 4 3 ("A" "u" "̈" "B")
> ("A" "ü" "B") first-mismatch-at 1)))
>
> I don't understand why string-glyph-split behave differently within the
> ERT test and
> I think that this is a bug.
It is not a bug, but a subtlety: string-glyph-split needs the current
buffer to be displayed in some window, in order for it to recognize
character composition. Evidently, ert doesn't make the buffer in
which it runs the test displayed in any window, so the composition of
"u" and "̈" doesn't happen.
Eli Zaretskii <eliz <at> gnu.org>:Ŝarl Bodler <sharl <at> bodler.eu>:Message #13 received at 79576-done <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: sharl <at> bodler.eu Cc: 79576-done <at> debbugs.gnu.org Subject: Re: bug#79576: 30.1; string-glyph-split and ert Date: Sat, 18 Oct 2025 11:19:47 +0300
> Cc: 79576 <at> debbugs.gnu.org
> Date: Sun, 05 Oct 2025 10:56:12 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
>
> > Date: Sat, 4 Oct 2025 15:41:24 +0200
> > From: Ŝarl Bodler <sharl <at> bodler.eu>
> >
> > Dear maintainers,
> >
> > I have encountered a possible bug when testing the function
> > string-glyph-split with an ERT test.
> >
> > 1) If I evaluate the following expression, the result is t :
> >
> > (equal (string-glyph-split "AüB")
> > (list "A" "ü" "B"))
> >
> > 2) If I create a new testing function with this expression and run it
> > with ert, the test is failing :
> >
> > (ert-deftest my-failing-test ()
> > (should (equal (string-glyph-split "AüB")
> > (list "A" "ü" "B"))))
> >
> > Selector: t
> > Passed: 0
> > Failed: 1 (1 unexpected)
> > Skipped: 0
> > Total: 1/1
> >
> > Started at: 2025-10-04 15:26:19+0200
> > Finished.
> > Finished at: 2025-10-04 15:26:20+0200
> >
> > F
> >
> > F my-failing-test
> > (ert-test-failed
> > ((should (equal (string-glyph-split "AüB") (list "A" "ü" "B")))
> > :form (equal ("A" "u" "̈" "B") ("A" "ü" "B")) :value nil
> > :explanation
> > (proper-lists-of-different-length 4 3 ("A" "u" "̈" "B")
> > ("A" "ü" "B") first-mismatch-at 1)))
> >
> > I don't understand why string-glyph-split behave differently within the
> > ERT test and
> > I think that this is a bug.
>
> It is not a bug, but a subtlety: string-glyph-split needs the current
> buffer to be displayed in some window, in order for it to recognize
> character composition. Evidently, ert doesn't make the buffer in
> which it runs the test displayed in any window, so the composition of
> "u" and "̈" doesn't happen.
No further comments within 2 weeks, so I'm now closing this bug
report.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.