From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Alexander Miller <alexanderm@web.de>
Cc: 45342@debbugs.gnu.org
Subject: bug#45342: 28.0.50; Native compiled function returns raw bytes, not string
Date: Sun, 20 Dec 2020 20:24:30 +0000 [thread overview]
Message-ID: <xjfft40usxt.fsf@sdf.org> (raw)
In-Reply-To: <b6f2922c-00e7-7bf3-84eb-92c347450343@web.de> (Alexander Miller's message of "Sun, 20 Dec 2020 18:36:46 +0100")
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
next prev parent reply other threads:[~2020-12-20 20:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-20 17:36 bug#45342: 28.0.50; Native compiled function returns raw bytes, not string Alexander Miller
2020-12-20 17:56 ` Eli Zaretskii
2020-12-20 20:24 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2020-12-21 13:45 ` Alexander Miller
2020-12-21 15:34 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-21 19:36 ` bug#45342: closed (Re: bug#45342: 28.0.50; Native compiled function returns raw bytes, not string) Alexander Miller
2020-12-21 20:01 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xjfft40usxt.fsf@sdf.org \
--to=bug-gnu-emacs@gnu.org \
--cc=45342@debbugs.gnu.org \
--cc=akrl@sdf.org \
--cc=alexanderm@web.de \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).