On Wed, Nov 23, 2022 at 1:40 AM Phillip Wood <phillip.wood123@xxxxxxxxx> wrote: > > + # Wait for completion of the asynchronously executed process > > + # to avoid race conditions in case of "emacsclient". > > + eval "$editor --eval \"(prog1 (switch-to-buffer-other-frame (compilation-start \\\"cat $@\\\" 'grep-mode)) (delete-other-windows) (while (get-buffer-process (current-buffer)) (sleep-for 0.1)) (select-frame-set-input-focus (selected-frame)))\"" > > I just tried this out in a frame (window for non emacs users) showing > two files and the (delete-other-windows) call replaced both of them with > the grep buffer. It would be nicer if it created a new window in the > current frame or showed the grep buffer in one of the existing windows. Thanks for your feedback. The first point is that you want to keep the same window configuration as before you do git jump, and reuse existing window (like M-x grep), right? I think "(delete-other-windows)" was superfluous, so I'll remove it. Will it do what you want? - In case of editor="emacsclient", it will try to keep window configuration. - In case of editor="emacsclient -t" and editor="emacs", it will create two window configuration (up and down). > If I delete (delete-other-windows) then the first time I run "git jump" > it shows the grep buffer in the frame I already have open, but then if I > run it again without closing the grep buffer it opens a new frame. I > wonder if it would be better just to close the buffer if it exists > before creating the new one or pass NAME-FUNCTION argument to > compilation-start that creates unique names. I've also seen a new frame being created unintentionally. It is caused by the wrong use of switch-to-buffer-other-frame. I'll try to fix. -- Yoichi NAKAYAMA