From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Chunyang Xu Newsgroups: gmane.emacs.bugs Subject: bug#26055: 25.1; Eshell dollar expansion $var[i] not working Date: Sat, 11 Mar 2017 17:35:05 +0800 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1489224985 10523 195.159.176.226 (11 Mar 2017 09:36:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Mar 2017 09:36:25 +0000 (UTC) To: 26055@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 11 10:36:15 2017 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 1cmdRZ-0001DQ-EF for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Mar 2017 10:36:09 +0100 Original-Received: from localhost ([::1]:42577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmdRc-0003U5-Px for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Mar 2017 04:36:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmdRW-0003Tn-T7 for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 04:36:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmdRT-0007kU-Pc for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 04:36:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52052) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmdRT-0007kO-Lp for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 04:36:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cmdRT-000487-Fk for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 04:36:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Chunyang Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Mar 2017 09:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26055 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.148922493315835 (code B ref -1); Sat, 11 Mar 2017 09:36:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Mar 2017 09:35:33 +0000 Original-Received: from localhost ([127.0.0.1]:50251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmdQz-00047L-ER for submit@debbugs.gnu.org; Sat, 11 Mar 2017 04:35:33 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmdQw-000478-NA for submit@debbugs.gnu.org; Sat, 11 Mar 2017 04:35:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmdQq-0007PO-Lf for submit@debbugs.gnu.org; Sat, 11 Mar 2017 04:35:25 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50187) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cmdQq-0007PF-J3 for submit@debbugs.gnu.org; Sat, 11 Mar 2017 04:35:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmdQp-0003Rt-Bh for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 04:35:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmdQm-0007OO-84 for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 04:35:23 -0500 Original-Received: from smtpbg65.qq.com ([103.7.28.233]:12503) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cmdQl-0007Li-Mr for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 04:35:20 -0500 X-QQ-mid: bizesmtp3t1489224907t5ii05mk8 Original-Received: from Chunyangs-MacBook-Air.local (unknown [114.236.194.125]) by esmtp4.qq.com (ESMTP) with SMTP id 0 for ; Sat, 11 Mar 2017 17:35:06 +0800 (CST) X-QQ-SSF: 0010000000200060F410B00A0000000 X-QQ-FEAT: sHG46Uoe4MxbJ3fx8ITfL2gH7B++Ql3vAlOdWFxDaCCGYTeCrMgRQYlg6bAJk UTfYyeVY2jYyICMNqTLuFMD0iT3jmnCi2NqycKIv87lyGB4BMLQML3IbSMs8XzjR/SeappB SwNIr2MG1n4vnePmLfBxbHqG+hcnvtqgm6oGDbY+PZm/dBNvZTH5A5UB4gkQlN2QxCuXd/u 0fUM/AsYtvTUyqPwb9QLRN71jzZR4iA4Z26XhIzcaXrb09Kb8lndaTiuzOEvB2aU= X-QQ-GoodBg: 0 X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:130471 Archived-At: I execute the following commands in Eshell ~ $ setq l (quote (a b c)) (a b c) ~ $ echo $l[1] ~ $ nth 1 $l b ~ $ I expect 'echo $l[1]' should print 'b' ~ $ setq s 'foo bar baz' foo bar baz ~ $ echo $s[1] ~ $ nth 1 (split-string s) bar ~ $=20 and 'echo $s[1]' should print 'bar' because in (info "(eshell) Dollars Expansion") it says =E2=80=98$var[i]=E2=80=99 Expands to the =E2=80=98i=E2=80=99th element of the value bound to =E2= =80=98var=E2=80=99. If the value is a string, it will be split at whitespace to make it a list. Again, raises an error if the value is not a sequence. Do I misunderstand this? Besides, the manual also says =E2=80=98$var[hello]=E2=80=99 Calls =E2=80=98assoc=E2=80=99 on =E2=80=98var=E2=80=99 with =E2=80=98"= hello"=E2=80=99, expecting it to be an alist (*note Association Lists: (elisp)Association List Type.). it looks like to me they are using the same syntax, if so, how can Eshell know which is which? ~ $ setq al (quote (("1" . one) ("2" . two))) (("1" . one) ("2" . two)) ~ $ echo $al[1] one ~ $