>> BTW, while looking at windows walking functions, I noticed >> an opportunity for simplification. >> >> Martin, could you please confirm if I'm not mistaken with this patch: > > Removing the > > (when (framep all-frames) > (select-window (frame-first-window all-frames) 'norecord)) > > LGTM. Whether we should remove the > > (save-selected-window > > envelope is another question. If FUN changes the selected window, > we'd now have a side effect we didn't have so far. So I left a comment explaining why save-selected-window is still needed. Now I prepared a patch for dired-dwim-target to DWIM most recently used windows from all frames: