From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#6991: Please keep bytecode out of *Backtrace* buffers Date: Sat, 19 Nov 2016 10:20:51 -0500 Message-ID: <87a8cvlcmk.fsf@users.sourceforge.net> References: <8739tm9vzl.fsf@jidanni.org> <87vb5ct1lz.fsf@gnus.org> <2223f654-1e67-4a9a-a471-828fd4078410@default> <87fumokzbp.fsf@users.sourceforge.net> <83oa1bc3x2.fsf@gnu.org> <87d1hrlek2.fsf@users.sourceforge.net> <83eg27bjah.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1479568880 30127 195.159.176.226 (19 Nov 2016 15:21:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 19 Nov 2016 15:21:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: lekktu@gmail.com, johnw@gnu.org, monnier@iro.umontreal.ca, 6991@debbugs.gnu.org, larsi@gnus.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 19 16:21:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c87S3-0006DF-Qz for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Nov 2016 16:21:12 +0100 Original-Received: from localhost ([::1]:41783 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c87S6-0001NZ-04 for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Nov 2016 10:21:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c87Rz-0001NP-TA for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 10:21:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c87Rv-0008RS-60 for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 10:21:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48108) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c87Rv-0008RL-25 for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 10:21:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c87Ru-0004pZ-8i for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 10:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Nov 2016 15:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6991 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6991-submit@debbugs.gnu.org id=B6991.147956880918480 (code B ref 6991); Sat, 19 Nov 2016 15:21:02 +0000 Original-Received: (at 6991) by debbugs.gnu.org; 19 Nov 2016 15:20:09 +0000 Original-Received: from localhost ([127.0.0.1]:35274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c87R2-0004o0-Ob for submit@debbugs.gnu.org; Sat, 19 Nov 2016 10:20:09 -0500 Original-Received: from mail-io0-f178.google.com ([209.85.223.178]:34842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c87Qz-0004nR-No for 6991@debbugs.gnu.org; Sat, 19 Nov 2016 10:20:07 -0500 Original-Received: by mail-io0-f178.google.com with SMTP id n13so7941086ioe.2 for <6991@debbugs.gnu.org>; Sat, 19 Nov 2016 07:20:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xK07P73HXM/2rrnup7vjXkeTBRq/lfhCIbxSn6Aq9tQ=; b=b9eVNABRiViMNZM7Z+N2maukJetRv5hRVdEuHZYtJHX1HqNQXps7Y8paEKjMknJGk4 SqKfJDLHnnk5GNaPYparPc3hSRF2amAhOocd1HdUiw54cbl+ZDfliWmYXzMDDHZXSztc qiiLOgHhW1Ugw4leJvt5lCbXXZeldSHuxmdI98FsijJaZhEdNxiJPHPPxurkr97nTPsl wSufArnTiO8KrKM5Cb22CmMfUnTm7sVpRCFDVraoMz21GAeHlw1kXxSLLY2pJOa4b28q UGqk2BnGbuIn58Ij6n8r/5kKIXhianLjOs14QF4yLzeNSrOj3AJQp9EfhP30gPqfIMqw vrfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=xK07P73HXM/2rrnup7vjXkeTBRq/lfhCIbxSn6Aq9tQ=; b=ekIgd42iFsfIKXKsmGHpjEuB322juXC7188xztFi6USiDDD0j6yH8AnWgfCrMgD76A kIni1Z/CEs2XuKclc/nKx79rWEjjRr+3SeS9lKrnxS0G7p8HK8sBrvkt2jeQAuaYUHlt 8m0w0I96yIQjmmQmJaF1X+AwOUR5JNazaIeB0WTfOeaZdUmPF7sv6YDWlnEvA785Ld7v MpFC2iKmQSgyOqwXo+VVJc3pBaqDEflZbFS1yjy+M9CuYRUzbAYVh716Coi1AUta/4ep +i4XU1A84C0cjZuBUCdj0bL6kDrjVie0MFCzWcXkiz7pr0Gvrf8/0RCWjFdXmCboxoHV 8qHQ== X-Gm-Message-State: AKaTC01B6KKl1lT2Qy8HkJ/vLjpQVx/nibvSlqC8HRn20IBA2ViHRbz0LAiGIQWMsab7tg== X-Received: by 10.107.155.70 with SMTP id d67mr4832837ioe.64.1479568800171; Sat, 19 Nov 2016 07:20:00 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id n206sm1656904itg.1.2016.11.19.07.19.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Nov 2016 07:19:59 -0800 (PST) In-Reply-To: <83eg27bjah.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Nov 2016 17:07:02 +0200") 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: 208.118.235.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:125875 Archived-At: Eli Zaretskii writes: >> From: npostavs@users.sourceforge.net >> Cc: 6991@debbugs.gnu.org, lekktu@gmail.com, johnw@gnu.org, monnier@iro.umontreal.ca, larsi@gnus.org, drew.adams@oracle.com >> Date: Sat, 19 Nov 2016 09:39:09 -0500 >> >> Eli Zaretskii writes: >> >> >> >> I would propose something like the below, which will cause the NUL byte >> >> to be rendered as \0 instead of ^@. We could potentially do this with >> >> other control characters too, if they cause trouble too? >> > >> > Isn't the fact that copying text into the clipboard stops at the first >> > null character a Windows-specific issue? And if it isn't Windows >> > specific, isn't it at least specific to selections? >> >> It seems to be application specific. When I copy to a Firefox text area >> on GNU/Linux I get a truncated result, but using xclip | od -c, I can >> see the NUL byte and following characters are there. > > If this happens on both Windows and X, then both xselect.c and > w32select.c should "encode" null bytes. Would that solve the problem? When printing a string literal, a null byte can be encoded as "\0", but in general, when copying an arbitrary piece of text this encoding might not necessarily be correct. > >> > Exactly. But if we change print_object like you suggest, there's no >> > way of being sure the null bytes won't be mangled by some application >> > of a print function. >> >> I'm not sure what you mean. > > A literal string can be printed, and the result is generally the > string itself. But with your suggestion, the null bytes will be > lossily converted to something else. I don't think it's lossy. Furthermore, newlines and form feeds are already being converted to "\n" and "\f", respectively. Bytes higher than 0x80 are also converted to octal escapes.