bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45342: 28.0.50; Native compiled function returns raw bytes, not stri


From: Andrea Corallo
Subject: bug#45342: 28.0.50; Native compiled function returns raw bytes, not string
Date: Sun, 20 Dec 2020 20:24:30 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Alexander Miller <alexanderm@web.de> writes:

> In my config I have the following function that is used to prettify my
> mode-line (the actual version is pure and side-effect-free and inlined,
> but that does not seem to have any effect here):
>
> (defun f (n)
>   (pcase n
>     (1 " ➊") (2 " ➋") (3 " ➌") (4 " ➍") (5 " ➎") (6 " ➏")
>     (7 " ➐") (8 " ➑") (9 " ➒") (10 " ➓") (_ "")))
>
> When native compiled it appears to return raw bytes instead of the
> unicode symbols, for example I am seeing \342\236\212 instead of ➊.
>
> I can circumvent that by using (1 (decode-coding-string " ➊" 'utf-8)),
> but of course that should not be necessary, since there's no such
> problem with the byte-compiled version.

Hi Alexander,

72c1a41573 fix this for me, would you like to confirm?

> And on a probably unrelated note: is it normal for such a simple
> function to be compiled to 100 LOC of assembly? That seems surprisingly
> to my amateur eyes.

Yes, big switch cases is ATM a case we do not generate optimal code for.

Thanks for the report!

  Andrea





reply via email to

[Prev in Thread] Current Thread [Next in Thread]