unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Drew Adams <drew.adams@oracle.com>
Cc: 37178@debbugs.gnu.org
Subject: bug#37178: 26.2; doc strings of `eshell' and `eshell-buffer-name'
Date: Sat, 19 Oct 2019 14:22:20 +0200	[thread overview]
Message-ID: <CADwFkmmtJ6uCfOB4S8=VrgJRGjyC40LkeVi1+QkAQREoEmpe6w@mail.gmail.com> (raw)
In-Reply-To: <0d877d24-e2d3-4b4c-b57d-aafd8cf77c3c@default>

Drew Adams <drew.adams@oracle.com> 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 exists, 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 original 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 largest 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 been 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 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 pick <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





  reply	other threads:[~2019-10-19 12:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-24 23:37 bug#37178: 26.2; doc strings of `eshell' and `eshell-buffer-name' Drew Adams
2019-10-19  1:00 ` Stefan Kangas
2019-10-19  5:21   ` Drew Adams
2019-10-19 12:22     ` Stefan Kangas [this message]
2019-10-19 12:47       ` Eli Zaretskii
2019-10-19 16:27       ` Drew Adams
2019-10-20 13:16         ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmmtJ6uCfOB4S8=VrgJRGjyC40LkeVi1+QkAQREoEmpe6w@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=37178@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).