Re: [PATCH v3 2/2] git-jump: invoke emacs/emacsclient
- From
Yoichi Nakayama <yoichi.nakayama@gmail.com>
- Date
- Nov 22, 2022, 12:06 UTC
- Message-ID
- <CAF5D8-sAmxDkduPbvEf-myr6iBm0N00SEDgCcSfNE99t9qSBmw@mail.gmail.com>
- In-Reply-To
- <Y3vId3rOmmkJnkGj@coredump.intra.peff.net>
On Tue, Nov 22, 2022 at 3:50 AM Jeff King <peff@peff.net> wrote:
Show 5 quoted lines
> You'll have to either shell-quote the contents, or stuff it in a > tempfile and read it with something like "cat /path/to/tempfile" in the > emacs command (though I'm not sure if that would be racy when you're > using something like emacsclient which may exit before the main emacs > process runs the command).
As you pointed out, the previous implementation has a problem in cases such as:
git jump grep "hello world"The reason I avoided using temporary files in the previous implementation was a race condition when editor="emacsclient" (emacsclient exits without waiting for the asynchronous execution of the external command). But I found a way around the race condition, so I'll change to use cat on a temporary file.
Thanks,
-- Yoichi NAKAYAMA