Function: next-error-follow-minor-mode

Minor mode for compilation, occur and diff modes.
With a prefix argument ARG, enable mode if ARG is positive, and
disable it otherwise. If called from Lisp, enable mode if ARG is
omitted or nil.
When turned on, cursor motion in the compilation, grep, occur or diff
buffer causes automatic display of the corresponding source code location.

Variable: next-error-follow-minor-mode

Non-nil if Next-Error-Follow minor mode is enabled.
Use the command `next-error-follow-minor-mode' to change this variable.