Re: [PATCH v7 3/3] git-jump: invoke emacs/emacsclient
- From
Yoichi Nakayama <yoichi.nakayama@gmail.com>
- Date
- Nov 25, 2022, 16:01 UTC
- Message-ID
- <CAF5D8-uxZOFi8p0bUMaqJCLFxipXCB9fo_Kx=QE6s=DW8Jspgg@mail.gmail.com>
- In-Reply-To
- <221125.8635a7o123.gmgdl@evledraar.gmail.com>
On Fri, Nov 25, 2022 at 6:08 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 11 quoted lines
> I'd really like to have some closer and smarter emacs integration like > this. > > But I don't see why we need to run the grep ourselves, pipe it to a > temporary file, and then discover that we're using emacs, and --eval > code into it to switch to that buffer, and fake up a "M-x grep" command > with a compilation buffer to make it look like we ran M-x grep in the > first place. > > Let's just ... run M-x grep earlier? Then we can skip all the earlier > steps.
There are two reasons.
First, I want to reuse the modes that git-jump already have. In addition to mode_grep, mode_{diff,merge,ws} exist, and if we re-implement each for editor support, I think it will be difficult to maintain.
Second, there is a difficulty passing arbitrary arguments properly to
Emacs Lisp properly.
For example, your version will cause error with
git jump grep "hello world"
My early patch was doing something similar. But the second problem was
hard to deal with,
so I switched to using a temporary file.-- Yoichi NAKAYAMA