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

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

bug#51716: 29.0.50; [PATCH] Expose xwidget navigation history to Lisp co


From: Eli Zaretskii
Subject: bug#51716: 29.0.50; [PATCH] Expose xwidget navigation history to Lisp code
Date: Sun, 14 Nov 2021 09:20:01 +0200

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: Po Lu <luangruo@yahoo.com>,  51716@debbugs.gnu.org
> Date: Sun, 14 Nov 2021 07:58:11 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > If they cannot include invalid UTF-8, then using decode_string_utf_8
> > is what you need to do.  You cannot use those strings directly in
> > Lisp, because they will be unibyte strings.  IOW, using build_string
> > there is incorrect, you need to use make_unibyte_string and
> > decode_string_utf_8 instead.  build_string is correct only for
> > plain-ASCII strings.
> 
> Can't he use make_multibyte_string instead?

I'd rather not.  Code which uses external strings without decoding
looks wrong, and the time it takes to convince yourself it does TRT
(if it does) is time lost.

decode_string_utf_8 is very fast, and xwidgets aren't supposed to be
in the inner loops of Emacs.  So I see no reason for shortcuts here.





reply via email to

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