From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#37178: 26.2; doc strings of `eshell' and `eshell-buffer-name' Date: Sat, 19 Oct 2019 14:22:20 +0200 Message-ID: References: <0d877d24-e2d3-4b4c-b57d-aafd8cf77c3c@default> 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="88352"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37178@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 19 14:23:13 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 1iLnlI-000Mqh-Ie for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Oct 2019 14:23:12 +0200 Original-Received: from localhost ([::1]:54000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLnlH-0001q8-EB for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Oct 2019 08:23:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33415) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLnl9-0001pz-8v for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2019 08:23:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLnl8-0006m8-7m for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2019 08:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43233) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iLnl8-0006lf-4G for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2019 08:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iLnl7-000476-VH for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2019 08:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Oct 2019 12:23:01 +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.157148775915770 (code B ref 37178); Sat, 19 Oct 2019 12:23:01 +0000 Original-Received: (at 37178) by debbugs.gnu.org; 19 Oct 2019 12:22:39 +0000 Original-Received: from localhost ([127.0.0.1]:52054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iLnkl-00046H-EI for submit@debbugs.gnu.org; Sat, 19 Oct 2019 08:22:39 -0400 Original-Received: from mail-pg1-f174.google.com ([209.85.215.174]:46140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iLnkj-000463-VI for 37178@debbugs.gnu.org; Sat, 19 Oct 2019 08:22:38 -0400 Original-Received: by mail-pg1-f174.google.com with SMTP id e15so4853719pgu.13 for <37178@debbugs.gnu.org>; Sat, 19 Oct 2019 05:22:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=CisJX5Jfb2vdO50AdurzOZdhN43SA8mjD5shKVb6MnU=; b=SVvV4i8CiE8K3WIGRdgPXKLzaNLTwlT41wVjIzlml1b+YhWwjF3fd0Mnuz8441VzS6 A7XIA7FrWElXlcC23fByhQBbcy+wOSsIxzHRvw746sC3K+9CIpztFujiQygqOHHdZGZE 7c9MsXFLUT5WEAsBwYRi9V2QgxWyaL+ZlV0gEPLHRwrc0Fov6UiR0yhhluV0z/nxIRoM mYjzhKoaCT+yK3MY/pbFOqGqrXaVBGsX8EvB7p5SKZOYZ5eYTI4QZAmyEh3CnbX39I74 VaPc38PkaAsrrggagYc8iUvdzbgB0KOxDxon/y7lbOnT5lbibCf3aVLmnfAnkpR+e3YG oocQ== X-Gm-Message-State: APjAAAWUwMqr1UvlcnBsl8ItOVSAtq1c1NdZTQmlORzY0OHuE13mCrfu he35DzxYLpP9AB31YdePMfcKZ9HHED6wwahOgVg= X-Google-Smtp-Source: APXvYqz+dXl84snjDHxz+bQnC85SD1sNrez1ikp1AO7Axngbc2KEyehvR7cUoDqND7AU+oa8fKYtPq+PZLlzccg8dYQ= X-Received: by 2002:a63:c10:: with SMTP id b16mr5550207pgl.333.1571487751911; Sat, 19 Oct 2019 05:22:31 -0700 (PDT) In-Reply-To: <0d877d24-e2d3-4b4c-b57d-aafd8cf77c3c@default> 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:169733 Archived-At: Drew Adams writes: > Yes, thanks; much better. Thanks for reviewing. > But the problem I pointed out is still there. > > If you use a numeric prefix arg and a buffer with that number already exi= sts, 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 orig= inal and your patch say). As mentioned, I tried `C-u' (numerically 4) with= one existing buffer, but it created buffer <2>, not <4>. > > Instead, a new buffer is created with, as number, the successor of the la= rgest existing one. Indeed. It treats a plain prefix argument ('C-u') differently from a numeric prefix argument ('C-u 42'). > Actually, even that might not be correct, if some existing buffers have b= een deleted. I don't have time now to check what happens in general - does= it pick the successor of the largest existing number? does it pick the fir= st number after an existing one before a hole, i.e., starting to fill in th= e hole? > > E.g., if there are buffers <2>, <3>, and <7>, does it pick <8>? does it p= ick <4>? It picks <4> in this case, which I think makes sense. But I don't think the doc string needs to go into that level of detail, since that part of the behaviour is less important than the use cases: 1. Create a new Eshell session, or pop to an existing. (M-x eshell) 2. Create a new Eshell session (C-u M-x eshell) 3. Visit given Eshell session (C-u 2 M-x eshell) All of that is actually already documented in the suggested doc string: Start a new Eshell session, or switch to an already active session. Return the buffer selected (or created). With a numeric prefix arg (as in `C-u 42 M-x eshell RET'), switch to the session with that number, or create it if it doesn't exist. A nonnumeric prefix arg means to create a new session. Maybe it could be made more clear, but I don't see how if we also want to keep it sufficiently succinct. Best regards, Stefan Kangas