Re: [PATCH 2/2] git-jump: invoke emacsclient
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Nov 19, 2022, 15:53 UTC
- Message-ID
- <CAPig+cSMoAoVW_NTidyN0rgTTY-FaQ49CAFQZhPyaYBsYu-RfA@mail.gmail.com>
- In-Reply-To
- <ed19668db860c8aafcb008aef306520e36d12dee.1668866540.git.gitgitgadget@gmail.com>
On Sat, Nov 19, 2022 at 9:09 AM Yoichi Nakayama via GitGitGadget <gitgitgadget@gmail.com> wrote:
Show 11 quoted lines
> It works with GIT_EDITOR="emacsclient" or GIT_EDITOR="emacsclient -t"
>
> Signed-off-by: Yoichi Nakayama <yoichi.nakayama@gmail.com>
> ---
> diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump
> @@ -26,6 +26,11 @@ open_editor() {
> +if git var GIT_EDITOR | grep ^emacsclient >/dev/null; then
> + type "mode_$mode" >/dev/null 2>&1 || { usage >&2; exit 1; }
> + open_emacsclient "$mode" "$@"
> + exit 0
> +fiWould it make sense to expand this to support the VISUAL and EDITOR environment variables too? For instance, since I want to use Emacs for all my editing needs, I have EDITOR set to reference emacsclient. So, if GIT_EDITOR is unset, then check VISUAL, and if that is unset, check EDITOR.
Also, on macOS, I need to set EDITOR (or GIT_EDITOR or VISUAL) to the full path of emacsclient, but the regex used here is too tight to recognize that. Perhaps loosening it to just 'emacsclient' would be a good idea (as it seems unlikely to falsely match any other editor)?