Re: [PATCH v4 2/2] git-jump: invoke emacs/emacsclient
- From
Jeff King <peff@peff.net>
- Date
- Nov 24, 2022, 16:31 UTC
- Message-ID
- <Y3+cepfUpi0vm7yM@coredump.intra.peff.net>
- In-Reply-To
- <CAF5D8-vXK81U_n06u=p=B9urTWyQ5+fN8_w9FeCWQOv1xen07Q@mail.gmail.com>
On Thu, Nov 24, 2022 at 09:58:04PM +0900, Yoichi Nakayama wrote:
Show 9 quoted lines
> > The original vim version used the notation \$1 instead of $1. > > I'm worried that the emacs version might need the backslash. > > What does the backslash mean? Is it necessary? > > I found the answer myself. The backslash is to leave the > evaluation of the argument to the 'eval' execution. > And another question arose. Why do we use eval? > What is the difference from running it directly like below? > $editor -q $1
The value of $editor is not a single program name, but is itself a shell command. So you could imagine:
git config core.editor "some_command --with --args"
or even more complicated shell hackery. From within Git, we'd run it as:
sh -c "some_command --with --args"
but when you are in a shell already, "eval" is a more efficient way of doing the same.
-Peff