From: Yoichi Nakayama Date: Tue, 22 Nov 2022 13:00:45 GMT Subject: Re: [PATCH v3 1/2] git-jump: add an optional argument '--stdout' Message-ID: In-Reply-To: On Tue, Nov 22, 2022 at 8:38 AM Junio C Hamano wrote: > > Jeff King writes: > > > On Mon, Nov 21, 2022 at 12:26:59PM +0000, Yoichi Nakayama via GitGitGadget wrote: > > > >> From: Yoichi Nakayama > >> +-------------------------------------------------- > >> +# In Emacs, M-x grep and invoke "git jump --stdout " > >> +Run grep (like this): git jump --stdout diff > >> +-------------------------------------------------- > > > > This example confused me because it says "run grep", but then runs a > > diff jump. But maybe this is because it means to run the emacs grep > > command? I don't use emacs, so it may make more sense to somebody who > > does. > > Yes. "M-x" gives Emacs users a command line prompt to type (and tab > complete) an Emacs command, and in the above explanation, the user > is running the "grep" command of Emacs, which in turn prompts for a > shell command that produces series of :: to > jump around [*]. > > "M-x grepgit jump --stdout diff" is what I would have > written on the second line instead of "Run grep (like this)...". I think Junio's suggestion of "M-x grepgit jump --stdout diff" is concise and understandable to most Emacs users, so I'd like to adopt it. Below are the details of what I thought: By M-x grep, Emacs displays Run grep (like this): grep --color=auto -nH --null -e where - "Run grep (like this): " is a prompt (like "$ " in bash). - "grep --color=auto -nH --null -e " is a part of search command (missing keyword part). We can supply "keyword" to execute the search. We can also remove the whole command and replace it with the command like "git jump --stdout diff". So "M-x grepgit jump --stdout diff" does not represent the complete procedure. It lacks the operation to remove the default command (controlled by the grep-command setting). For example, adding C-a C-k after "M-x grep" is more accurate, but it feels a bit redundant. -- Yoichi NAKAYAMA