On Wed, Nov 23, 2022 at 3:54 AM Jeff King <peff@xxxxxxxx> wrote: > 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). > 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