I have a multi monitor setup and I typically have two Emacs frames, each filling a monitor.

I use display-buffer-reuse-window (reusable-frames . T) as my only customisation.

One thing bugs me in my workflow, I call next-error a lot and it will move the point to the next error in the compile buffer, and open the bad code in the window that I started in, but the focus remains in the compile buffer!

Is there a way to make the focus change frame when calling next-error? (when it needs to)

Right now I need to type C-x 5 o after every next-error when I'm using two monitors.

I've tried adding advice to go to the other frame after, but it doesn't seem to have any effect.

  • To clarify terms, please have a look at What's the difference between a buffer, a file, a window, and a frame? – Dan May 27 '16 at 10:45
  • The following link contains an example of how to target specific frames and windows to displaying a particular buffer How to intercept a file before it opens and decide which frame: stackoverflow.com/q/18346785/2112489 – lawlist May 27 '16 at 14:04
  • 2
    "the focus remains in the compile buffer". That sounds like a bug, to me. Consider reporting it: M-x report-emacs-bug. Preferably, provide a step-by-step recipe to reproduce it, starting with emacs -Q (no init file) - include any settings (e.g. customizations) needed to repro it. – Drew May 27 '16 at 16:11
  • @dan which term needs to be clarified? – fommil May 27 '16 at 16:25
  • 2
    Maybe just M-x grep some files? Grep output (search hits) are considered "errors" in this regard. – Drew May 27 '16 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.