From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#54486: 29.0.50; Eshell `escaped' string property can "leak" into output Date: Mon, 21 Mar 2022 14:19:59 +0200 Message-ID: <834k3rfqfk.fsf@gnu.org> References: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33394"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54486@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 21 13:21:26 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nWH2L-0008Si-99 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Mar 2022 13:21:25 +0100 Original-Received: from localhost ([::1]:56740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWH2K-0000aK-45 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Mar 2022 08:21:24 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWH21-0000ZG-5R for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 08:21:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nWH1y-0005Ob-A3 for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 08:21:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nWH1y-0007S3-6p for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 08:21: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: Mon, 21 Mar 2022 12:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54486 X-GNU-PR-Package: emacs Original-Received: via spool by 54486-submit@debbugs.gnu.org id=B54486.164786523628591 (code B ref 54486); Mon, 21 Mar 2022 12:21:02 +0000 Original-Received: (at 54486) by debbugs.gnu.org; 21 Mar 2022 12:20:36 +0000 Original-Received: from localhost ([127.0.0.1]:36073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWH1Y-0007R4-1s for submit@debbugs.gnu.org; Mon, 21 Mar 2022 08:20:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWH1W-0007Qr-Ft for 54486@debbugs.gnu.org; Mon, 21 Mar 2022 08:20:34 -0400 Original-Received: from [2001:470:142:3::e] (port=40934 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWH1R-0005Jg-7X; Mon, 21 Mar 2022 08:20:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=UhAG17/RBeWXRbBEWHPhahgSRu54PJ5+Tqloll/SwtU=; b=nMpEsXpzy27q dGCl5zfKHZ3dD98RG/vYVC1sjAkFlNh+5U6/VOSEn4s+qdBiyUw6oozKq+mvXf0XWfLVEP/4Fs5qe C5YTZ6z6siAEgYYOKV5td5p1ZwMuGPThfS7/dmToZBBc0+gmfax4I119BpDJ3xNYwwehRlCDgEjEa vU9hegB9VczaFZVDKIKmZxMwYHN5ZhpKrsQ1Fn5FJ2xVqVj/VToFPupmbZLmTzvm0jMY7k1N9whuK RbVppQE+Ty/uUFmH/5S3Fxzf4AJydsKWgUi2grgOS1yHM4JOTjThboe04kOZz3oihwlMsGssPDlZj 7cZ/w9ZoExFYdVHfZCvVNA==; Original-Received: from [87.69.77.57] (port=3330 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWH1I-0005up-Hr; Mon, 21 Mar 2022 08:20:28 -0400 In-Reply-To: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> (message from Jim Porter on Sun, 20 Mar 2022 20:52:43 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228660 Archived-At: > From: Jim Porter > Date: Sun, 20 Mar 2022 20:52:43 -0700 > > When using Eshell, it's possible to inadvertently add an `escaped' > string property to strings, resulting in some pretty surprising > behavior. Starting from "emacs -Q --eval '(eshell)'": > > ~ $ setq var (list "foo" "bar") > ("foo" "bar") > ~ $ echo $var > ("foo" "bar") > ~ $ echo $var[0] > foo > ~ $ echo $var > (#("foo" 0 3 > (escaped t)) > "bar") > > This happens because when the `$var[0]' argument is parsed in the third > command, the function `eshell-interpolate-variable' wraps the > code-to-be-called with `eshell-escape-arg'. That function adds an > `escaped' property to any string passed into it. > > The `escaped' property is used to indicate that the string should be > treated literally (i.e. any special characters like "$" will no longer > have any special meaning in Eshell). That's the right *behavior*, but > ideally, there'd be a way to do so that doesn't involve manipulating the > string like this. Eshell can't know the lifetime of the string, and it > seems like a bad idea in general to go around messing with string > properties just because you referenced that string somehow in Eshell. > > I can't think of an obvious fix for this though. Any ideas? Why exactly do you think this should be fixed? I don't think I understand that from your description. We have many features that add text properties to strings, so why is this one different? About the only thing I can think of is to add this property to the default value of yank-excluded-properties, but that's all.