Subject: bug#30674: 27.0.50; flymake-mode should set next-error-function and (probably) next-error-last-buffer

From: Juri Linkov <[email-masked]>
Date: Wed, 07 Mar 2018 00:33:59 +0200

> Considering the names and docstrings of next-error and previous-error, I
> think it's quite reasonable to expect to be able to navigate the Flymake
> diagnostics with them.
>
> João, was there a particular reason you decided against it? Can we
> improve next-error somehow, for this to become more appealing?
>
> Juri, any thoughts? The foremost apparent difficulty is that virtually
> any file-editing buffer can become a next-error capable buffer. Would
> opening a new file interactively (with flymake-mode being turned on)
> automatically change next-error-last-buffer? Would it change after
> save-buffer (after which diagnostics are normally refreshed)?

I think it would be a natural fit into the next-error framework.  How to
solve conflicts with other sources of next-error is an open question.
For example, after running ‘occur’ on the flymake-mode enabled buffer
next-error should continue navigating ‘occur’ hits.  I guess to cancel
such navigation is possible in at least three ways: doing window-quit
on the *Occur* buffer, or using next-error-select-buffer selecting
the current buffer (instead of the *Occur* buffer), or re-running flymake
on the buffer.