From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#58810: 29.0.50; [PATCH] 'eshell-stringify' sometimes produces wrong results Date: Wed, 26 Oct 2022 18:22:13 -0700 Message-ID: <04d2f9ab-df6c-409e-7815-d75152bbba02@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------7s0qWWsYYehl6o92Dl0qHTRf" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16645"; mail-complaints-to="usenet@ciao.gmane.io" To: 58810@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 27 03:23:42 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 1onrcU-0004BI-1g for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Oct 2022 03:23:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onrbs-0000z1-A3; Wed, 26 Oct 2022 21:23:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onrbq-0000kc-S8 for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 21:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onrbq-0006px-Kz for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 21:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1onrbq-0006Zu-Bo for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 21:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Oct 2022 01:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58810 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166683374525230 (code B ref -1); Thu, 27 Oct 2022 01:23:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Oct 2022 01:22:25 +0000 Original-Received: from localhost ([127.0.0.1]:55638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onrbF-0006Yr-5R for submit@debbugs.gnu.org; Wed, 26 Oct 2022 21:22:25 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:38452) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onrbC-0006Yh-17 for submit@debbugs.gnu.org; Wed, 26 Oct 2022 21:22:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onrbB-0005vO-Od for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 21:22:21 -0400 Original-Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onrb9-0006Oa-Le for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 21:22:21 -0400 Original-Received: by mail-pl1-x62e.google.com with SMTP id f23so16016492plr.6 for ; Wed, 26 Oct 2022 18:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:from:content-language:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=JCqVeH33I/8wcKmGadwiwoiQHkgm5UQ8wMsNSQAz6iQ=; b=UuiFekhO/xbH/AkFXe4YEwdeEztwQb7kXpqJkH2V1LiG8+9cI9pYnua8ZG/xS/8RGd mg+qd1N1OclFfMAkU/otZX2lPPKNOFcQk4fKTdBrU0ULaqkSURTOgpGoFfJ+URhZD1ZW 0+SW7Y9lUtNpbim2hXvmLguhJ9bK1A8sWhwJRa7xTfvgmw236TSmK6JpjXUtzhJq5Dvz ERuigz+WZHcEWCkBZq2snZFxthN5yaM4LVB5OOdWfmoNrVQWMS7kckOPIceHiBuu++7E gP44X6KmMKSZVES8rftwyXpooMYs3AsS+XQP77Kdo0DU9v/LUPtJOZa2l1jqEIbU3ogg 1kEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:from:content-language:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JCqVeH33I/8wcKmGadwiwoiQHkgm5UQ8wMsNSQAz6iQ=; b=X4BFbHPrsnQ/2gZnbFsSoPYuzkIHr6RuMIK8XhSsGAqiGZEd67njaDBVLuyaGtRQqJ jRSSC1eHKMt1qcV7uG7RLKV7qZxSdDQpkFKYHP1Ijo9iLGiFiqVfgOheCqdu++7/1k84 Osc5FfiqmZ1d6RO+W8Q9PhFwnBTW7k6AfaDTPyLR3A5dYbpSS2GOg/p2G1xnHVxWygrb 1YWX7G0wH6lQLAx6XF2uj3POqwpunLQnE0OaBRQnLro7un80CHZ/TjNBpTLMNsyfywTT bl9UpJRYaOIDKvxpHYWIefPw5UD0xBkMooZvQpJtQYSNqOqij8QL/QgeGyXX4ax5DFI6 Z5ug== X-Gm-Message-State: ACrzQf0n2NDC+jdlANuZLRvgmj5jKZO+XTXWxNFVxVt1wuYwSeiGCG4N tptGh5b5P5i6pV+Yo29ZFBcufbY0iKw= X-Google-Smtp-Source: AMsMyM4OsFGvqQzoAmKM6ExsaPH+SDjtiAYW5i5GltXG2JbRjtgwA/UaK6WCyOa3JThi06yCwfrlyg== X-Received: by 2002:a17:90a:ad08:b0:212:d5f1:e0c6 with SMTP id r8-20020a17090aad0800b00212d5f1e0c6mr7094427pjq.228.1666833737229; Wed, 26 Oct 2022 18:22:17 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id b3-20020a170903228300b00186b55e3cd6sm3541113plh.133.2022.10.26.18.22.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Oct 2022 18:22:16 -0700 (PDT) X-Mozilla-News-Host: news://news.gmane.io:119 Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=jporterbugs@gmail.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246266 Archived-At: This is a multi-part message in MIME format. --------------7s0qWWsYYehl6o92Dl0qHTRf Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Starting from "emacs -Q -f -eshell": ~ $ echo $(list 'quote 'hello) 'hell The last character of "hello" was stripped. That's because 'eshell-stringify' tries to remove the trailing newline from 'pp-to-string', but it does so by always stripping the last character from the result. Obviously, that only works when the last character really is a newline. Attached is a patch with regression tests for 'eshell-stringify' so that this works correctly. --------------7s0qWWsYYehl6o92Dl0qHTRf Content-Type: text/plain; charset=UTF-8; name="0001-Only-strip-newlines-when-stringifying-a-value-for-Es.patch" Content-Disposition: attachment; filename*0="0001-Only-strip-newlines-when-stringifying-a-value-for-Es.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSBiYjQ0MDMxNmE1YTM4M2JhYjA5MWU1YjM1NTc3OGRiNTAyYmExYTNiIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IFN1biwgMTggU2VwIDIwMjIgMTc6NDI6MDkgLTA3MDAKU3ViamVjdDogW1BB VENIXSBPbmx5IHN0cmlwIG5ld2xpbmVzIHdoZW4gc3RyaW5naWZ5aW5nIGEgdmFsdWUgZm9y IEVzaGVsbAoKKiBsaXNwL2VzaGVsbC9lc2gtdXRpbC5lbCAoZXNoZWxsLXN0cmluZ2lmeSk6 IFVzZSAnc3RyaW5nLXRyaW0tcmlnaHQnCmluc3RlYWQgb2Ygc3RyaXBwaW5nIHRoZSBsYXN0 IGNoYXJhY3RlciBvZiB0aGUgcmVzdWx0IG9mCidwcC10by1zdHJpbmcnLgoKKiB0ZXN0L2xp c3AvZXNoZWxsL2VzaC11dGlsLXRlc3RzLmVsOiBOZXcgZmlsZS4KLS0tCiBsaXNwL2VzaGVs bC9lc2gtdXRpbC5lbCAgICAgICAgICAgIHwgMTEgKysrLS0tCiB0ZXN0L2xpc3AvZXNoZWxs L2V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