From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#37178: 26.2; doc strings of `eshell' and `eshell-buffer-name' Date: Sat, 19 Oct 2019 05:21:19 +0000 (UTC) Message-ID: <0d877d24-e2d3-4b4c-b57d-aafd8cf77c3c@default> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="65857"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37178@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 19 07:24:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iLhDo-000H21-1q for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Oct 2019 07:24:12 +0200 Original-Received: from localhost ([::1]:49438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLhDm-0002FJ-DG for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Oct 2019 01:24:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54855) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLhDf-0002Et-He for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2019 01:24:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLhDe-0002LZ-Dm for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2019 01:24:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42975) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iLhDe-0002LV-9l for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2019 01:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iLhDe-000451-3N for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2019 01:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Oct 2019 05:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37178 X-GNU-PR-Package: emacs Original-Received: via spool by 37178-submit@debbugs.gnu.org id=B37178.157146261415645 (code B ref 37178); Sat, 19 Oct 2019 05:24:02 +0000 Original-Received: (at 37178) by debbugs.gnu.org; 19 Oct 2019 05:23:34 +0000 Original-Received: from localhost ([127.0.0.1]:51796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iLhDC-00044F-5O for submit@debbugs.gnu.org; Sat, 19 Oct 2019 01:23:34 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:57078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iLhD9-000440-4T for 37178@debbugs.gnu.org; Sat, 19 Oct 2019 01:23:31 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9J5Ixcu193346; Sat, 19 Oct 2019 05:23:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=aMDJte3rwvcBYJhRtxB52NqxqDI82+gK/JemejDp1mw=; b=OzVloPakYQH6WQTjyTqcoGWUrGuDsKt56IS78v6+TfO46ZqJpfrA+FJPQm8Xn3tqQSq9 JCp+KA2rc7bttv05BjxmEVScd5CAqXCgqP+izjUqQEfkHNE/9fUDryZwh2I5G1r/3p+i YuZazolxqxWF08BDIi46HmqABUKZpCuh5BSMg0Otk99rUv/DF08cxSJXpOiOndeOdlXo hy+Vv+MsjEYcekNRa9a6gccsTsRWqD/Mz6iULa0nGbI5rh/6kjFs0Xb3103jbT4zO9oa dddgF+idrM3wsJmgIYmLdZ80w7Y5+JC/ZfHn3fEaTofC5NWAnSj7+2XaaltDl24EmiQ6 4A== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2vqswt0auc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 19 Oct 2019 05:23:22 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9J5J9vp123445; Sat, 19 Oct 2019 05:21:22 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2vqqmgxf3e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 19 Oct 2019 05:21:21 +0000 Original-Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x9J5LKZZ011625; Sat, 19 Oct 2019 05:21:20 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4900.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9414 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910190051 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9414 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910190051 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: 209.51.188.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:169696 Archived-At: > > This is the `eshell' doc string: > > > > Create an interactive Eshell buffer. > > The buffer used for Eshell sessions is determined by the value of > > 'eshell-buffer-name'. If there is already an Eshell session active > in > > that buffer, Emacs will simply switch to it. Otherwise, a new > session > > will begin. A numeric prefix arg (as in 'C-u 42 M-x eshell RET') > > switches to the session with that number, creating it if necessary. > A > > nonnumeric prefix arg means to create a new session. Returns the > > buffer selected (or created). > > > > That's a wall of text. But the problem to report here is that the > > _number_ of a session is unclear. What is it and, especially, what, > if > > anything, does it have to do with `eshell-buffer-name'. > > > > Experimenting a bit, a guess is that the names of Eshell buffers use > > `eshell-buffer-name' followed, by all but the first, by "", where > N =3D > > 2,3,4... as additional sessions are created. And with a numeric > prefix > > arg M, `eshell' tries to find a session with buffer name ending in > . > > > > E.g., I tried `M-x eshell' followed by `C-u M-x eshell'. The first > > created buffer `*eshell*', and the second created buffer > `*eshell<2>*' > > (not `*eshell<4>*', BTW). > > > > This naming convention should be described in the doc string, in > order > > to make clear (1) how `eshell-buffer-name' is used as a "base name" > and > > (2) how the prefix arg relates to the buffer-name convention. > > > > Also, the doc string for variable `eshell-buffer-name' is poor. > That's > > really where the use of the value as a "base name" needs to be > described > > (i.e., make clear what is mean by "base name" and how multiple eshell > > buffers are named). >=20 > How about the attached patch? Yes, thanks; much better. But the problem I pointed out is still there. If you use a numeric prefix arg and a buffer with that number already exist= s, then it is used. No problem. But if you use a numeric prefix arg and no buffer with that number exists, = it's not true that a buffer with that number is created (as both the origin= al and your patch say). As mentioned, I tried `C-u' (numerically 4) with o= ne existing buffer, but it created buffer <2>, not <4>. Instead, a new buffer is created with, as number, the successor of the larg= est existing one. Actually, even that might not be correct, if some existing buffers have bee= n deleted. I don't have time now to check what happens in general - does i= t pick the successor of the largest existing number? does it pick the first= number after an existing one before a hole, i.e., starting to fill in the = hole? E.g., if there are buffers <2>, <3>, and <7>, does it pick <8>? does it pic= k <4>? Not very important, but the text as written is not exact.