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#55838: 29.0.50; Eshell string-split subscript indexing splits too much Date: Tue, 7 Jun 2022 18:36:09 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15765"; mail-complaints-to="usenet@ciao.gmane.io" To: 55838@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 08 03:37:40 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 1nykdg-0003zh-AJ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Jun 2022 03:37:40 +0200 Original-Received: from localhost ([::1]:33962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nykde-0001qf-Va for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jun 2022 21:37:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nykdL-0001qK-9a for bug-gnu-emacs@gnu.org; Tue, 07 Jun 2022 21:37:21 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48080) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nykd4-0002bu-2g for bug-gnu-emacs@gnu.org; Tue, 07 Jun 2022 21:37:18 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nykd3-0003j0-Rk for bug-gnu-emacs@gnu.org; Tue, 07 Jun 2022 21:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Jun 2022 01:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55838 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165465218114269 (code B ref -1); Wed, 08 Jun 2022 01:37:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Jun 2022 01:36:21 +0000 Original-Received: from localhost ([127.0.0.1]:41977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nykcP-0003i5-5C for submit@debbugs.gnu.org; Tue, 07 Jun 2022 21:36:21 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:41150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nykcK-0003ht-38 for submit@debbugs.gnu.org; Tue, 07 Jun 2022 21:36:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nykcJ-0001ar-Rr for bug-gnu-emacs@gnu.org; Tue, 07 Jun 2022 21:36:15 -0400 Original-Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:56083) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nykcF-0002Z1-99 for bug-gnu-emacs@gnu.org; Tue, 07 Jun 2022 21:36:15 -0400 Original-Received: by mail-pj1-x1034.google.com with SMTP id e9so6703583pju.5 for ; Tue, 07 Jun 2022 18:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:subject:to:message-id:date:mime-version:content-language :content-transfer-encoding; bh=bnCJzBZNhTk6vDjOQjcZeg/Z6UqF9cJ0xp29YQab/eQ=; b=m/EIaeafSBEss68JwppgTANNB13iGSemRIbyw5sm0nlQzmsgSz17tOjItSEemvOQ6b d6VgqMrchppXpzqTWK7zlaHFT7xU8tRtylVDIBFbyexYMp+/oQzFJF7ROKCZukMqTGZa jHWWInoaOABLM6LsHgpsLEGnb446fQcj7d5QBpaFENhcwHuCO9vUxIhp9kLao0gLoQny UgWRTNxg/2KUHGBunbddBqRvbV+FZo4CSBCREaE67QZthaBuEHNaCahyFfGfsdxhG6MP N5XNeIjwRsWYkojvC3MgQGQcxBGAo5mb+dMTdYqOxSanRCSUDszr+074FKrGyY8cFDju Jasw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:message-id:date:mime-version :content-language:content-transfer-encoding; bh=bnCJzBZNhTk6vDjOQjcZeg/Z6UqF9cJ0xp29YQab/eQ=; b=LemdI4MkzR0pxfzGkYN8eKlSSFfK4N8izINYLZ8Vzq8YCBg7dYVtrZi15nk3KP28+M BTCY646rvhqTXFcRQ3n5awTb3Sf5f4HBPvbab9SIC4PPU+ccfwpcbyVa5A5xBsAivatO XCvXHyDUXd9xg+NYYGmLvEc8JzKDLR2bFs/yEJ6LG/d+jngW7O1M70K396WlJuNX1cCN 9QkCIQk6HtM6cMKbgO33nOuM5C6T9Y659ULbGLKXxe9hKJrd5cDvF3dKGP/X0iiaEMHs B5m9Dfa8o2tGSKzYf7v4QXqPz+crf+992adIK41PHFVPttYL5pZeKM/7XhiWm+y9G1gA mC+Q== X-Gm-Message-State: AOAM530MKsIcLRPHu/nEO3s28v9GmJvBzuZnyQk6QLBfKr6oitmDwNJZ US1JU5vIQA0EiABYnsFviBmvp4U5kc8= X-Google-Smtp-Source: ABdhPJwbrn+kmEzJo1X8QDPsJ65CcIsEWsoy5tuo5C3Pr/L0o3WETBEpBX8sGpZ4BWuEzd+Ecd5Y3A== X-Received: by 2002:a17:90b:1e4f:b0:1e8:4e3c:e212 with SMTP id pi15-20020a17090b1e4f00b001e84e3ce212mr23420231pjb.25.1654652169991; Tue, 07 Jun 2022 18:36:09 -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 x140-20020a633192000000b003f84815f6bdsm13763889pgx.82.2022.06.07.18.36.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jun 2022 18:36:09 -0700 (PDT) X-Mozilla-News-Host: news://news.gmane.org:119 Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=jporterbugs@gmail.com; helo=mail-pj1-x1034.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, T_SCC_BODY_TEXT_LINE=-0.01 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: , 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:233942 Archived-At: From "emacs -Q -f eshell": M-: (setq foo "a\nb:c") ~ $ echo $foo a b:c ~ $ echo $foo[: 0] ("a" "b") The first command is normal, and just shows that Eshell outputs the string with no manipulation. In the second command, we split the string on ":" and get the 0th element. However, that gets split *again* (on newlines) and returns a list. I think this is overly aggressive. It's due to `eshell-apply-indices' calling `eshell-convert' on the split element(s) of the string. However, `eshell-convert' is primarily designed to turn output from external command line programs into a Lispy form (so it splits by line to make a list, among other things). This would normally happen when doing something like this: ~ $ echo ${cat some-file.txt} ("line 1" "line 2" ...) In the original case above, I think the split-subscript operator [: 0] should only be doing the one thing the user requested: split on ":" and get the 0th element. Patch forthcoming momentarily. Just getting a bug number.