Re: [PATCH v4 2/2] git-jump: invoke emacs/emacsclient
- From
Yoichi Nakayama <yoichi.nakayama@gmail.com>
- Date
- Nov 23, 2022, 05:33 UTC
- Message-ID
- <CAF5D8-vSsBsdiA8SiDgqUFkL9_3N-v+psVxj-AcibOB88gxWfA@mail.gmail.com>
- In-Reply-To
- <Y30a0ulfxyE7dnYi@coredump.intra.peff.net>
On Wed, Nov 23, 2022 at 3:54 AM Jeff King <peff@peff.net> wrote:
Show 5 quoted lines
> Hmm, I know I suggested using a temporary file since "cat $tmpfile" > should be pretty safe. But it does still have problems if your tmp > directory has spaces. Or even other metacharacters, which I think will > be interpreted by the eval, since $@ is expanded in the outermost level > of the shell.
Right. But the problem is not specific to emacs (it happens in vim too). Let's fix it another time (as you noted, that's pretty unlikely, and we may not even need to fix it).
Show 13 quoted lines
> If we are going to use a tempfile, this logic should probably get
> stuffed into open_editor itself, like:
>
> open_editor() {
> editor=`git var GIT_EDITOR`
> case "$editor" in
> *emacs*)
> ...do-the-emacs-thing...
> *)
> # assume anything else is vi-compatible
> eval "$editor -q \$1"
> esac
> }Sure.
-- Yoichi NAKAYAMA