unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jim Porter <jporterbugs@gmail.com>
Cc: 60846@debbugs.gnu.org
Subject: bug#60846: 29.0.60; [PATCH] Add more documentation about Eshell command invocation
Date: Mon, 16 Jan 2023 15:38:15 +0200	[thread overview]
Message-ID: <83wn5m4n20.fsf@gnu.org> (raw)
In-Reply-To: <e5d0f9e6-357d-0d96-7047-15c7b4bfbb90@gmail.com> (message from Jim Porter on Sun, 15 Jan 2023 18:51:25 -0800)

> Date: Sun, 15 Jan 2023 18:51:25 -0800
> From: Jim Porter <jporterbugs@gmail.com>
> 
> The Eshell manual isn't as thorough as it could be about how users 
> should invoke commands. While there's a reasonable amount of 
> documentation about the details, it never directly describes how to run 
> a simple command.
> 
> Attached is a patch to remedy this. I also corrected the documentation 
> about how Eshell picks what command to run in command form; previously, 
> it stated that ordinary Lisp functions had higher priority than external 
> commands, which isn't actually the case (unless you set 
> 'eshell-prefer-lisp-functions').

Thanks.

> Since this is purely a documentation change, I'd like to merge this to 
> the Emacs 29 branch.

That's fine.

> +Unlike regular system shells, Eshell never invokes kernel functions
> +directly, such as @code{exec(3)}.  Instead, it uses the Lisp functions
> +available in the Emacs Lisp library.  It does this by transforming the
> +input line into a callable Lisp form.@footnote{To see the Lisp form
> +that will be invoked, type: @samp{eshell-parse-command 'echo hello'}}

This should use the @kbd markup, like any command the user should
type.  I also suggest to say explicitly that you mean to type this at
the Eshell prompt, as it wasn't clear when I read it.

> +The command can be either an Elisp function or an external command.
> +Eshell looks for the command in the following order:

Here I would add a few useful index entries

  @cindex order of looking for commands
  @cindex command look up, order

> +@vindex eshell-prefer-lisp-functions
> +If you would prefer to use ordinary Lisp functions over external
> +programs, set the option @code{eshell-prefer-lisp-functions} to
> +@code{t}.

I'm guessing this swaps the order of the two last candidates, but the
text doesn't say that explicitly for some reason.  Just saying
"prefer" is not enough when you have more than 2 candidates.

> +In addition, you can @emph{combine} command forms and Lisp forms
> +together into single statements, letting you use whatever form is the
> +most convenient for expressing your intentions.
> +
> +@example
> +~ $ ls *.patch > (format-time-string "%F.log")
> +@end example

Either explain here the meaning of redirecting into a Lisp form, or
add a cross-reference to where it is explained in detail.

> +specify an argument of some other data type, you can use a
> +@ref{Invocation, Lisp form}:

This kind of cross-references is usually a bad idea in Texinfo: it
looks nifty in HTML, but reads awkwardly in all other formats.  It is
better to use the slightly wordier alternative:

  specify an argument of some other data type, you can use a Lisp form
  (@pxref{Invocation}):






  parent reply	other threads:[~2023-01-16 13:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16  2:51 bug#60846: 29.0.60; [PATCH] Add more documentation about Eshell command invocation Jim Porter
2023-01-16  4:01 ` Jim Porter
2023-01-16 13:38 ` Eli Zaretskii [this message]
2023-01-16 20:18   ` Jim Porter
2023-01-17 13:05     ` Eli Zaretskii
2023-01-17 22:01       ` Jim Porter

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=83wn5m4n20.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=60846@debbugs.gnu.org \
    --cc=jporterbugs@gmail.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).