From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: lg.zevlg@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#34873: 27.0.50; Creating unibyte string in emacs modules Date: Sat, 16 Mar 2019 11:32:47 +0100 Message-ID: <88B2D883-45AD-4432-9FE1-D4E24709E294@gmail.com> References: <83ef77z371.fsf@gnu.org> Mime-Version: 1.0 (1.0) Content-Type: multipart/alternative; boundary=Apple-Mail-85660367-73CD-4524-B6BF-CF2C41110E1E Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="192442"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34873@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 16 11:34:05 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 1h56dg-000nwH-Iz for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Mar 2019 11:34:04 +0100 Original-Received: from localhost ([127.0.0.1]:39928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h56df-0003SL-7u for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Mar 2019 06:34:03 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h56dU-0003Rt-B5 for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2019 06:33:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h56cg-00038f-Gq for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2019 06:33:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60498) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h56cg-00038Y-C6 for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2019 06:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h56cg-0008Iu-8Y for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2019 06:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: lg.zevlg@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Mar 2019 10:33: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.155273237631901 (code B ref 34873); Sat, 16 Mar 2019 10:33:02 +0000 Original-Received: (at 34873) by debbugs.gnu.org; 16 Mar 2019 10:32:56 +0000 Original-Received: from localhost ([127.0.0.1]:45808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h56cZ-0008IS-U5 for submit@debbugs.gnu.org; Sat, 16 Mar 2019 06:32:56 -0400 Original-Received: from mail-ed1-f52.google.com ([209.85.208.52]:44782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h56cY-0008IE-PO for 34873@debbugs.gnu.org; Sat, 16 Mar 2019 06:32:55 -0400 Original-Received: by mail-ed1-f52.google.com with SMTP id x10so6502522edh.11 for <34873@debbugs.gnu.org>; Sat, 16 Mar 2019 03:32:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=5u4dArbv53jtBSZQXNT3atb3AK4UydT1uWsMPltFgCk=; b=DEo41jVsEHmKcNRVqemuCEODcT6owOO0VnpQdJ6wDA2h9C/dBpPkBucLw7EVZ1FemH mQ2+KXQY3N3IPc+CsP+j41DMUCCp7P/TyVS4wgv0I8dceUGt587BtvTYX5l/GGMFUqn4 eRzwfO9fydbZ5Etu1tF1YWY+9fWeU9AuvkndXmSHKLVarLeSbFg0PZZkM/qbks2cK+M3 yFMC7USpFTGuzLQ6gyos+Dt86Vvbr+WXT7B1Oe8XVxdRVpkmuwMf8fuUEckGbniKZUDI hhIxFzDSr3QjX4n2JkWcqlseyD4sA+b4SXZfHOV3qwy/xM9ACEhnnBGcfvRS8/cZAfz7 CgjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=5u4dArbv53jtBSZQXNT3atb3AK4UydT1uWsMPltFgCk=; b=tRvac+J6j3Fuu6EAeN5Rsv3qKpERcTEGisARHx8TJCtdXJLxpNMygvaGUZspyqf2zD +JIQt72Ue0usHp2EN6rdfZlNMyYDEAZ3SA5J6cChg7lfoD8FaDrWbt5oO+hgiYWL6WKm RdKc2FDcvcUa7shUOtkFXzsXoRrRjKKnSraaqVLoQiA4/LMsa4b/s6/8/nbFYI4xrg2w VOvvLvaw4ESClMThS8GRNm6xSdsD2qej+jKWAPZ7aWKaPOpvN7zmfYg2q7BmSC4Eb8F+ r1Aa4x0r8MfEtdQWw/r1U1cL0P5yWBHYoOwtCxEuYHH9SjrYGc6GtrRgow6Sz/MteHl7 hWDg== X-Gm-Message-State: APjAAAXoSLJKXxQNJ16TzYV0EyHi/4/Ww1y+JRg1LRODxgV/49AvTnX2 +z+YNl61wZDdjmw9uYGyBVjSApcV/jg= X-Google-Smtp-Source: APXvYqzAe4S1/OUEx5oE6VGPC+W+uHHYEx/2B02sCDxYTLEs0zCo7t5VXOgTwX77rx8VUu99zmcCig== X-Received: by 2002:a50:d8c2:: with SMTP id y2mr6018462edj.65.1552732368832; Sat, 16 Mar 2019 03:32:48 -0700 (PDT) Original-Received: from [10.247.36.21] (46-253-189-211.dynamic.monzoon.net. [46.253.189.211]) by smtp.gmail.com with ESMTPSA id h14sm1393491eds.11.2019.03.16.03.32.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Mar 2019 03:32:48 -0700 (PDT) X-Mailer: iPad Mail (16A404) In-Reply-To: <83ef77z371.fsf@gnu.org> 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:156407 Archived-At: --Apple-Mail-85660367-73CD-4524-B6BF-CF2C41110E1E Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 16 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2019 =D0=B3., =D0=B2 8:30, Eli Zaretskii <= eliz@gnu.org> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): >> From: Evgeny Zajcev >> Date: Fri, 15 Mar 2019 23:52:17 +0300 >>=20 >> There is no possibility to create unibyte strings from emacs modules in o= rder to create some binary data >> representation >>=20 >> 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 >>=20 >> I used this patch to bypass the conversion steps and it works pretty nice= >>=20 >> Ideally I would like to use user-ptr objects as `:data' in image specific= ation, but solution with `make_data' >> module method will be suitable enough >=20 > 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. See this thread https://lists.gnu.org/archive/html/emacs-devel/2019-03/msg00= 465.html I need this module, because all existing packages to manipulate images are n= ot capable enough for me =E2=80=94 lg --Apple-Mail-85660367-73CD-4524-B6BF-CF2C41110E1E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
16 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2019 =D0=B3., =D0=B2 8:30, Eli Zare= tskii <eliz@gnu.org> =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0):

From: Evge= ny Zajcev <lg.zevlg@gmail.com&g= t;
Date: Fri, 15 Mar 2= 019 23:52:17 +0300

There is no possibilit= y to create unibyte strings from emacs modules in order to create some binar= y data
representation=

The only solution for now is to call `ma= ke_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 e= nough

Please explain why you n= eed to create a unibyte string for that.  I
guess what'= s missing is more details regarding what you are trying to
d= o (the single sentence above about :data wasn't enough for me), andhow is your module involved in that, in particular why do you need a=
module to display an image in Emacs.


I need this module, because all existing package= s to manipulate images are not capable enough for me

=E2=80=94=
lg

= --Apple-Mail-85660367-73CD-4524-B6BF-CF2C41110E1E--