From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34873: 27.0.50; Creating unibyte string in emacs modules Date: Sat, 16 Mar 2019 09:30:26 +0200 Message-ID: <83ef77z371.fsf@gnu.org> References: Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="4290"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34873@debbugs.gnu.org To: Evgeny Zajcev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 16 08:31:20 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h53mp-0000y6-RB for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Mar 2019 08:31:19 +0100 Original-Received: from localhost ([127.0.0.1]:38630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h53mo-0001Kl-RP for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Mar 2019 03:31:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h53md-0001KV-5o for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2019 03:31:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h53mb-0007Lt-7T for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2019 03:31:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60443) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h53mY-0007IU-Nf for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2019 03:31:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h53mY-0003pj-IB for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2019 03:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Mar 2019 07:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34873 X-GNU-PR-Package: emacs Original-Received: via spool by 34873-submit@debbugs.gnu.org id=B34873.155272145014718 (code B ref 34873); Sat, 16 Mar 2019 07:31:02 +0000 Original-Received: (at 34873) by debbugs.gnu.org; 16 Mar 2019 07:30:50 +0000 Original-Received: from localhost ([127.0.0.1]:45754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h53mM-0003pJ-8v for submit@debbugs.gnu.org; Sat, 16 Mar 2019 03:30:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47155) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h53mK-0003p4-4m for 34873@debbugs.gnu.org; Sat, 16 Mar 2019 03:30:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h53mE-0007De-Od; Sat, 16 Mar 2019 03:30:42 -0400 Original-Received: from [176.228.60.248] (port=1389 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h53mE-0003dY-92; Sat, 16 Mar 2019 03:30:42 -0400 In-reply-to: (message from Evgeny Zajcev on Fri, 15 Mar 2019 23:52:17 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156406 Archived-At: > From: Evgeny Zajcev > Date: Fri, 15 Mar 2019 23:52:17 +0300 > > There is no possibility to create unibyte strings from emacs modules in order to create some binary data > representation > > The only solution for now is to call `make_string` method and then apply `encode-coding-string' with utf-8 > encoding to the result. But on large data this became very slow > > I used this patch to bypass the conversion steps and it works pretty nice > > Ideally I would like to use user-ptr objects as `:data' in image specification, but solution with `make_data' > module method will be suitable enough Please explain why you need to create a unibyte string for that. I guess what's missing is more details regarding what you are trying to do (the single sentence above about :data wasn't enough for me), and how is your module involved in that, in particular why do you need a module to display an image in Emacs.