Using @which inside a macro on expr

Okay, I found a solution with macroexpand myself. And because other people might like hit, here the complete macro:

julia> macro splitedit(ex...)
           m = eval(macroexpand(Main, :(@which $(ex...))))
           file, line = functionloc(m)
           editor = ENV["EDITOR"]
           editorcmd = "$editor +$line $file"
           splitcmd = `tmux split-window "$editorcmd"`
           run(splitcmd)
           nothing
       end
@splitedit (macro with 1 method)

julia> @splitedit println("hallo") # same as @edit, but in a new tmux pane