From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Sun, 22 Nov 2015 21:10:58 +0000 Message-ID: References: <83k2ptq5t3.fsf@gnu.org> <87h9kxx60e.fsf@lifelogs.com> <877flswse5.fsf@lifelogs.com> <8737wgw7kf.fsf@lifelogs.com> <87io5bv1it.fsf@lifelogs.com> <87egfzuwca.fsf@lifelogs.com> <876118u6f2.fsf@lifelogs.com> <8737w3qero.fsf@lifelogs.com> <831tbn9g9j.fsf@gnu.org> <878u5upw7o.fsf@lifelogs.com> <83ziya8xph.fsf@gnu.org> <83y4du80xo.fsf@gnu.org> <837fld6lps.fsf@gnu.org> <83si3z4s5n.fsf@gnu.org> <83mvu74nhm.fsf@gnu.org> <83d1v34hba.fsf@gnu.org> <83io4u2aze.fsf@gnu.org> <8337vx3kp6.fsf@gnu.org> <83y4dp24pq.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=047d7bb04dc43afcfd0525278c58 X-Trace: ger.gmane.org 1448226681 29672 80.91.229.3 (22 Nov 2015 21:11:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Nov 2015 21:11:21 +0000 (UTC) Cc: aurelien.aptel+emacs@gmail.com, tzz@lifelogs.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 22 22:11:20 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a0bup-0005Qn-CN for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2015 22:11:19 +0100 Original-Received: from localhost ([::1]:57548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0bup-0000dr-EB for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2015 16:11:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0buk-0000dZ-25 for emacs-devel@gnu.org; Sun, 22 Nov 2015 16:11:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0bui-0004t1-Qd for emacs-devel@gnu.org; Sun, 22 Nov 2015 16:11:13 -0500 Original-Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:36002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0bug-0004sd-Qv; Sun, 22 Nov 2015 16:11:11 -0500 Original-Received: by wmww144 with SMTP id w144so74912525wmw.1; Sun, 22 Nov 2015 13:11:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=os5h5cXxoWn3hwwnTVn8PebullHlhwaWcmf+Agv4xns=; b=SbBxuPNixBmtw7if6wulyx5dL1WrSkkQsfWcmrmD6ZpzAqGJXgoSfy7SJDYGdhoiCZ Pb0ndha3Wr6w5pD/4gih3QLb03a6cePVx20XjP30oVqkr7sTg0R/bk7ffIRxxqv8zLwW h5/oPqKqnZH1/LI8vQkjjoobO1ki9n5oDU/+89JYx6B7DKHBcKBsiHnNWAdylI23EEZ9 ktrLOnfwpBqxO09EsG8KcPNFmQzZ96n+S66u0vw2zIVMU3fWI4y97/kNulX2OH3ORkVI MLYJMsXmoJktPObZbiGMeRcAoCGj0+D9sM2/sy+9m6vw7uvJgoAalN+u5F4ziaCiRsC/ zydQ== X-Received: by 10.195.13.135 with SMTP id ey7mr26415456wjd.25.1448226670059; Sun, 22 Nov 2015 13:11:10 -0800 (PST) In-Reply-To: <83y4dp24pq.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c09::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195069 Archived-At: --047d7bb04dc43afcfd0525278c58 Content-Type: multipart/alternative; boundary=047d7bb04dc43afcf60525278c56 --047d7bb04dc43afcf60525278c56 Content-Type: text/plain; charset=UTF-8 Eli Zaretskii schrieb am So., 22. Nov. 2015 um 20:51 Uhr: > > > No matter what we expect or tolerate, we need to state that. > > > > No, we don't. When the callers violate the contract, they cannot > > expect to know in detail what will happen. If they want to know, they > > will have to read the source. > > > > So you want this to be unspecified or undefined behavior? That might be > OK (we > > already have that in several places), but we still need to state what the > > contract is. > > You can call it "undefined behavior" if you want. Personally, I don't > think that's accurate: "undefined" means anything can happen, whereas > Emacs at least promises to output the original bytes unchanged, as > long as the text modifications didn't touch them. > "Unspecified" would fit the bill better. Actually for most interesting inputs (UTF-8 strings) the behavior is well-defined anyway. > > > > An Emacs string is a sequence of integers. > > > > No, it's a sequence of bytes. > > > > From > > > https://www.gnu.org/software/emacs/manual/html_node/elisp/String-Basics.html > : > > "In Emacs Lisp, characters are simply integers ... A string is a fixed > sequence > > of characters" > > That's the _User_ manual, it simplifies things to avoid too much > complexity. > So where's the programmer's manual then? The source code? ;-) > > > How a string is represented internally shouldn't be the concern of module > > authors. > > Indeed. But it does concern us, the developers of Emacs internals. > > > No, I will definitely fix it. > > Thank you. > Attached a patch that uses make_multibyte_string directly. --047d7bb04dc43afcf60525278c56 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= So., 22. Nov. 2015 um 20:51=C2=A0Uhr:
>=C2=A0 =C2=A0 =C2=A0> No matter what we expect or tolerate, we n= eed to state that.
>
>=C2=A0 =C2=A0 =C2=A0No, we don't. When the callers violate the cont= ract, they cannot
>=C2=A0 =C2=A0 =C2=A0expect to know in detail what will happen. If they = want to know, they
>=C2=A0 =C2=A0 =C2=A0will have to read the source.
>
> So you want this to be unspecified or undefined behavior? That might b= e OK (we
> already have that in several places), but we still need to state what = the
> contract is.

You can call it "undefined behavior" if you want.=C2=A0 Personall= y, I don't
think that's accurate: "undefined" means anything can happen,= whereas
Emacs at least promises to output the original bytes unchanged, as
long as the text modifications didn't touch them.
=
"Unspecified" would fit the bill better. Actually = for most interesting inputs (UTF-8 strings) the behavior is well-defined an= yway.
=C2=A0

>=C2=A0 =C2=A0 =C2=A0> An Emacs string is a sequence of integers.
>
>=C2=A0 =C2=A0 =C2=A0No, it's a sequence of bytes.
>
> From
> https://www.gnu.org= /software/emacs/manual/html_node/elisp/String-Basics.html:
> "In Emacs Lisp, characters are simply integers ... A string is a = fixed sequence
> of characters"

That's the _User_ manual, it simplifies things to avoid too much
complexity.

So where's the programm= er's manual then? The source code? ;-)
=C2=A0

> How a string is represented internally shouldn't be the concern of= module
> authors.

Indeed.=C2=A0 But it does concern us, the developers of Emacs internals.
> No, I will definitely fix it.

Thank you.

Attached a patch that uses m= ake_multibyte_string directly.=C2=A0
--047d7bb04dc43afcf60525278c56-- --047d7bb04dc43afcfd0525278c58 Content-Type: application/octet-stream; name="0001-Improvements-to-string-conversions.patch" Content-Disposition: attachment; filename="0001-Improvements-to-string-conversions.patch" Content-Transfer-Encoding: base64 Content-ID: <151310911aeeb2f02891> X-Attachment-Id: 151310911aeeb2f02891 RnJvbSA2ZTViMDU1MDc4ZmU3MTU1Yzg3MWExYjY4MjU3ZDM3MDVhZWIyY2ViIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsaXBwIFN0ZXBoYW5pIDxwaHN0QGdvb2dsZS5jb20+CkRh dGU6IFN1biwgMjIgTm92IDIw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24gKGVtYWNzX2VudiAqZW52LCBwdHJkaWZmX3QgbWluX2FyaXR5LCBw dHJkaWZmX3QgbWF4X2FyaXR5LAogICBlbnZwdHItPmRhdGEgPSBkYXRhOwogCiAgIExpc3BfT2Jq ZWN0IGVudm9iaiA9IG1ha2Vfc2F2ZV9wdHIgKGVudnB0cik7CisgIExpc3BfT2JqZWN0IGRvYzsK KyAgaWYgKGRvY3VtZW50YXRpb24gPT0gTlVMTCkKKyAgICBkb2MgPSBRbmlsOworICBlbHNlCisg ICAgeworICAgICAgcHRyZGlmZl90IG5ieXRlcyA9IHN0cmxlbiAoZG9jdW1lbnRhdGlvbik7Cisg ICAgICBwdHJkaWZmX3QgbmNoYXJzLCBpZ25vcmVkX25ieXRlczsKKyAgICAgIHBhcnNlX3N0cl9h c19tdWx0aWJ5dGUgKGRvY3VtZW50YXRpb24sIG5ieXRlcywgJm5jaGFycywgJmlnbm9yZWRfbmJ5 dGVzKTsKKyAgICAgIGRvYyA9IG1ha2VfbXVsdGlieXRlX3N0cmluZyAoZG9jdW1lbnRhdGlvbiwg bmNoYXJzLCBuYnl0ZXMpOworICAgIH0KKwogICBMaXNwX09iamVjdCByZXQgPSBsaXN0NCAoUWxh bWJkYSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QyIChRYW5kX3Jlc3QsIFFhcmdz KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50YXRpb24gPyBidWlsZF9zdHJp bmcgKGRvY3VtZW50YXRpb24pIDogUW5pbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGRv YywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QzIChtb2R1bGVfY2FsbF9mdW5jLAog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudm9iaiwKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBRYXJncykpOwpAQCAtNTE1LDIxICs1MjcsMzQgQEAgbW9kdWxl X2NvcHlfc3Rya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